Security forces in Burkina Faso retook a hotel in the capital on Saturday a day after al Qaeda fighters seized it in an assault that killed two dozen people from at least 18 countries, marking a major escalation of Islamist militancy in West Africa.
Until Friday's attack, the landlocked nation, an ally of Western governments against jihadist groups in the arid reaches of the southern Sahara, had largely been spared the violence that has plagued its neighbors.
The assault follows a similar raid in November on a luxury hotel in Mali's capital Bamako which killed 20 people, including citizens of Russia, China and the United States.
The Ouagadougou assault, claimed by al Qaeda in the Islamic Maghreb (AQIM), marked an expansion of operations for Islamist militants who are stepping up their activities, echoing the growth of Islamic State in the Middle East.
President Roch Marc Christian Kabore said 23 people of 18 different nationalities were killed in the 146-room Splendid Hotel and the nearby Cappuccino restaurant popular with Westerners and French soldiers based in Burkina Faso.
The authorities gave no further details of the victims, but the French government announced on Saturday that two French citizens were among the dead. Paris pledged to send scientific police to help investigate the attack, and a French court opened an investigation for murder and attempted murder.
One Cappuccino survivor said diners at first mistook the gunfire and explosions for firecrackers before two gunmen, dressed all in black and brandishing AK-47 assault rifles, burst in firing indiscriminately.
"We heard shots, grenades, detonations. It was echoing and extremely loud. It went on for a long time," the survivor, a Slovenian social anthropologist told Reuters.
"They kept coming back and forth into Cappuccino. You'd think it was over, then they'd come back and shoot more people. They would come back and see if the white people were moving and then they would shoot them again," she said.
"My friend had a white dead person on top of her, bleeding onto her. But his body saved her," said the woman, who asked that her name not be used.
"The situation we're experiencing since yesterday in Burkina Faso is unprecedented," Kabore said when he visited the scene of the attack. "These are vile, cowardly acts and the victims are innocent people."
French ambassador Gilles Thibault put the death toll at 27 and said on Twitter that around 150 hostages had been freed in an operation that received support from French and U.S. forces.
Burkinabe authorities said that around 33 people had been injured and that four assailants, including an "Arab" and two "black Africans", were killed.
Another survivor, a French architect called Ludovic who was at an outdoor bar near Cappuccino when the attacks started, said he saw three assailants singling out white victims before running into the Splendid Hotel.
Separately, the security ministry said an Austrian doctor and his wife were kidnapped overnight in the Baraboule area in the north near the border with Mali.
However, an Austrian foreign ministry spokesman later said that there were "definitely no Austrians" abducted, and other media reports identified those kidnapped as citizens of Australia.
It was not clear if there was a link to the hotel attack.
The attackers torched cars and fired in the air to drive people back before entering the Splendid Hotel and taking hostages at around 8.30 p.m. (2030 GMT) on Friday.
French and U.S. military personnel backed up Burkina Faso security forces when they launched their operation to reclaim the Splendid Hotel in the early hours of Saturday, though their progress through the building was slowed by explosives planted by the militants.
France normally has up to 200 special forces troops in the country as part of a regional anti-militant operation.
A Reuters witness said major clashes ended after a period of sustained gunfire and explosions that appeared to focus on the Cappuccino restaurant early on Saturday.
Sporadic gunfire continued through the morning however. The final assailant was killed later in another nearby hotel, the Hotel Yibi, officials said.
While many in Burkina Faso and across the region were shocked by the raid, there have been indications that the security situation in the majority Muslim but religiously diverse nation was deteriorating.
"There have been warning signs and if there is an element of surprise it is that this did not come earlier," said Cynthia Ohayon, West Africa analyst at International Crisis Group.
Al-Mourabitoun, the group the joined forces with AQIM to mount November's attack on Bamako's Radisson hotel, said in May 2015 that it was holding a Romanian man kidnapped from a mine in northern Burkina Faso the previous month.
France's embassy warned its citizens in December against traveling to a national park in Burkina Faso following reports that Malian jihadists were threatening to kidnap foreigners.
And just hours before Friday's assault on the Splendid Hotel, two people, a gendarme and a civilian, were killed when a convoy of gendarmes was attacked near Burkina Faso's border with Mali.
A nearly identical attack occurred in the same area in October, though the government at the time accused the leaders of a failed coup.
Ohayon said it was no coincidence that such incidents have only happened since Burkina Faso's President Blaise Compaore was driven from power. The longtime leader's ouster likely ended a convenient relationship between Burkina Faso and militants that had, until then, protected the country, she said.
"Compaore had high connections with rebel and Islamist groups, and he helped to free hostages while some group members had houses in Ouagadougou," she said.
(Additional reporting by Joe Bavier in Abidjan, Emma Farge and Makini Brice in Dakar, Shadia Nasralla in Vienna, and Leigh Thomas in Paris; Writing by Joe Bavier and Ed Cropley; Editing by Ralph Boulton)