Mali on Saturday began three days of national mourning and declared a state of emergency after a nine-hour siege by Islamist gunmen at a top hotel in the capital left at least 27 people dead.
The assault, claimed by Al-Qaeda affiliate the Al-Murabitoun group led by notorious one-eyed Algerian militant Mokhtar Belmokhtar, ended after Malian and international troops stormed the luxury Radisson Blu hotel in Bamako.
The attack came as fears are mounting about terrorist threats a week after devastating attacks in Paris that killed 130 people claimed by the Islamic State group, which also claimed it had downed a Russian passenger jet in Egypt weeks before.
The Malian government declared a 10-day nationwide state of emergency from midnight on Friday over the assault and called three days of mourning for the victims, who included three Chinese, an American and a Belgian.
Malian security sources said 27 out of more than 100 people taken hostage in the raid had died, while at least three "terrorists" were killed or blew themselves up.
US President Barack Obama on Saturday condemned the "appalling" attack, adding that "this barbarity only stiffens our resolve to meet this challenge" of extremist violence.
Chinese foreign ministry spokesman Hong Lei expressed condolences for the victims and their families, adding: "China expresses indignation and strongly condemns this atrocity."
UN Secretary General Ban Ki-moon also condemned the "horrific terrorist attack," suggesting the violence was aimed at destroying peace efforts in the country.
Mali has been torn apart by unrest since the north fell under the control of Islamist militant groups linked to Al-Qaeda in 2012.
The Islamists were largely ousted by a French-led military operation launched the following year, but large swathes of Mali remain lawless and prone to attacks.
The assault began around 0700 GMT on Friday, when gunmen pulled up at the hotel at same time as a car with diplomatic plates and starting shooting their way inside, taking guests and staff hostage.
Malian television broadcast chaotic scenes from inside the building as police and other security personnel ushered bewildered guests along corridors to safety.
Special forces -- including Malian, French and two US soldiers who also happened to be in the area -- staged a dramatic floor-by-floor rescue, ending the siege after about nine hours.
"The hostage-taking is over. We are in the process of securing the hotel," a Malian military source said as civil protection officers removed the victims in orange body bags.
President Ibrahim Boubacar Keita, who returned from a summit early because of the attack, on Twitter hailed the "the professionalism of Mali's defence and security forces" and thanked other countries for their help.
In an audio recording broadcast by Qatar-based Al-Jazeera television, Belmokhtar's group said it was responsible.
"We the Murabitoun, with the participation of our brothers from Al-Qaeda in the Islamic Maghreb, claim the hostage-taking operation at the Radisson hotel," a man's voice said.
French Defence Minister Jean-Yves Le Drian said Belmokhtar, one of the world's most-wanted men, was indeed "likely" the brains behind the assault.
The militant is also accused of being the ring-leader of an attack on a gas plant in Algeria in 2013, in which around 40 mostly Western hostages were killed.
The palatial 190-room Radisson, regarded as one of west Africa's best hotels, is a favourite with entrepreneurs, tourists and government officials from across the world.
Witnesses talked of around a dozen armed assailants, but the Malian military source reported the deaths of three "terrorists who were shot or blew themselves up", adding that the total number of gunmen was not more than four.
Guinean singer Sekouba Bambino Diabate, who was among the survivors, told AFP the gunmen spoke English among themselves.
"They were firing inside the hotel, in the corridors," Diabate said.
A paramedic said three security guards had been wounded while an AFP correspondent saw a police officer, who had been shot, being evacuated by security forces.
Malian soldiers, police and special forces were at the scene soon after the attack began, along with members of the UN's MINUSMA peacekeeping force in Mali and French troops deployed in west Africa under Operation Barkhane.
Beijing's state media said that three Chinese citizens had been killed while a further four managed to escape.
A senior US State Department official confirmed a US citizen was among the victims, with another dozen Americans surviving the attack, while a Belgian regional assembly said one of its officials was also killed.
India said 20 of its nationals were freed. Twelve Air France employees were declared safe by the airline, while seven Turkish Airlines crew members, seven Algerians and two Germans were also freed.
France has more than 1,000 troops in its former colony, a key battleground of the Barkhane counter-terror mission spanning five countries in Africa's restive Sahel region.
The attack follows a hotel siege in August in the central Mali town of Sevare in which five UN workers were killed along with four soldiers and four attackers.
Five people, including a French citizen and a Belgian, were also killed in an assault on a Bamako restaurant in March, the first of its kind in the city.