Islamist militants killed 19 people in an attack on a top hotel in the capital of Mali before Malian commandos stormed the building and rescued 170 people, many of them foreigners.

Two militants were killed.

President Ibrahim Boubacar Keita announced the death toll and said seven people were wounded in the attack, which has been claimed by jihadist group Al Mourabitoun and al Qaeda in the Islamic Maghreb (AQIM).

Friday's assault on the Radisson Blu hotel comes a week after deadly Islamic State attacks in Paris that killed 130 people. Tha Mali attack was the latest in a series of deadly raids this year on high-profile targets in the country, which has battled Islamist rebels based in its desert north for years.

"Tonight the death toll is heavy," Keita said on state television, declaring a 10-day state of emergency and three days of national mourning. The president, who cut a short visit to a regional summit in Chad, said two militants also died.

In a speech on the sidelines of a summit with Asian nations in Malaysia, U.S. President Barack Obama described the raid in Mali as "another awful reminder of the scourge of terrorism".

"Once again, this barbarity only stiffens our resolve to meet this challenge," he said. "We will stand with the people of Mali as they work to rid their country of terrorists and strengthen their democracy. With allies and partners, the United States will be relentless."

The attack is a sharp setback for former colonial power France, which has stationed 3,500 troops in northern Mali to try to restore stability after a rebellion in 2012 by ethnic Tuaregs that was later hijacked by jihadists linked to al Qaeda.

It also puts a spotlight on veteran militant leader Mokhtar Belmokhtar, whose group Al Mourabitoun staged the attack months after he was reported killed in an air strike.

Minister of Internal Security Colonel Salif Traoré said the gunmen burst through a hotel security barrier at 7 a.m, spraying the area with gunfire and shouting "Allahu Akbar", or "God is great" in Arabic.

"At first I thought it was a carjacking. Then they killed two guards in front of me and shot another man in the stomach and wounded him and I knew it was something more," said Modi Coulibaly, a Malian legal expert who saw the assault start.

The attack ended around 4 p.m. In an earlier report, a U.N. official said U.N. peacekeepers searching the hotel made a preliminary count of 27 bodies.

As troops stormed the hotel, state television showed them brandishing AK47s in the lobby. A body lay under a brown blanket at the bottom of a flight of stairs.

The U.S. State Department said one American was killed. The White House said it was working to locate all Americans in Mali, and it offered to help with an investigation and urged its citizens to limit their movements around Bamako.

A man who worked for a Belgian regional parliament was also among the dead, the assembly said. France's Defence Minister Jean-Yves Le Drian said he was not aware of any French nationals killed.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.