Seventeen people have been killed and eight wounded in a "terrorist attack" in the centre of the capital of Burkina Faso, Ouagadougou, the government says.
Witnesses were quoted as saying that three gunmen opened fire on customers seated outside a hotel and restaurant.
The city centre has been sealed off by the army, and the US embassy in Ouagadougou has warned its citizens to avoid the area.
A jihadist attack on a cafe nearby left 30 people dead in January last year.
There are fears that the attack is the work of one of the affiliates of al-Qaeda that are active in the Sahel region, the BBC's Alex Duval Smith reports.
The shooting began shortly after 21:00 (21:00 GMT) on Sunday on Ouagadougou's busy Kwame Nkrumah Avenue.
Two locations, Hotel Bravia and the Aziz Istanbul Restaurant, appear to have been at the centre of the shooting.
"The attack claimed 17 victims, their nationalities are yet to be confirmed, and eight injured," said a government statement quoted by the AFP news agency.
Image copyrightREUTERSImage captionA wounded restaurant customer sits on the ground after the attack
A hospital in the city said that one of those killed was Turkish.
The attack is similar to one in January 2016, when the Splendid Hotel and the nearby Cappucino restaurant, also on Kwame Nkrumah Avenue, were targeted.
Over 170 people were taken hostage and 30 were killed. Al-Qaeda claimed responsibility for that attack.
Burkina Faso is part of the Sahel region, which includes Mali where Islamist groups have been active since 2012.
Media captionThomas Fessy explains how the siege started and how special forces brought it to an end
Burkina Faso's government says 26 people were killed and a further 56 injured after Islamist militants attacked a hotel in the capital, Ouagadougou, popular with foreigners.
Al-Qaeda in the Islamic Maghreb (AQIM) has said it carried out the attack, which began on Friday night.
Those killed come from at least 18 different countries, and include two French nationals and two Swiss.
Burkina Faso is to observe 72 hours of national mourning for the victims.
The siege at the Splendid Hotel was declared over after a joint operation by local and French security forces.
At least four attackers died in the assaults. There were claims that some of those involved were women.
As well as the luxury hotel, a cafe and another hotel nearby were targeted. Image copyrightEPAImage caption About 150 hostages were freed, Burkinabe officials say Image copyrightAPImage caption The hotel is popular with UN workers and foreign residents of Burkina Faso Bukinabe President Roch Kabore, who arrived at the scene on Saturday morning amid tight security, said at least 150 hostages had been liberated.
The French government said two of its nationals were killed in the assault, and one is known to be injured. French medical teams were providing support, and forensic officers were travelling to Ouagadougou, it added.
Switzerland confirmed that two of the dead were Swiss citizens, who had been in the cafe which came under attack.
In another development, the Burkina Faso government said a foreign doctor and his wife were kidnapped on Friday night in the north of the country, near the border with Mali. There was initial confusion over the pair's nationality - the Burkinabe government said they were Austrian, but later corrected this to Australian.
In November, an AQIM attack on a hotel in Bamako, capital of neighbouring Mali, left 19 people dead.
At the scene: Thomas Fessy, BBC News
The area surrounding the Splendid Hotel has been cordoned off. Soldiers can still be seen walking in and out of the building but the siege is now over.
At least three cars parked right outside the front door are completely charred, the remains of another two sit just across the street. Two burnt motorbikes lie in the middle.
The light purple colour of the Splendid Hotel's front side now looks black, probably caused by the smoke generated by explosions.
The Yibi hotel, opposite the Splendid, also shows signs of the attack, and the authorities say at least one attacker was killed inside the building. US hostage describes Burkina terror Image copyrightEPAImage caption The exterior of the Splendid Hotel was damaged by car bombs Image copyrightAnonymousImage caption A foreign soldier could be seen on the roof of the hotel Militants attacked the Splendid and the nearby Cappuccino cafe on Friday evening, setting off several explosions. Both places are popular with UN staff and foreigners.
Survivors described how the militants went from person to person, touching their bodies to see if they moved.
"They started shooting, shooting, and everybody lay down on the ground," said Mariette, who escaped from the hotel with her younger sister.
"As soon as you lifted your head they would shoot straightaway, so you had to pretend to be dead. And they even came to touch our feet to check if we were alive. As soon as you were alive, they would shoot at you."
Background: Tomi Oladipo, BBC Africa security correspondent
Al-Qaeda in the Islamic Maghreb grew from a remnant of a defunct rebel force, rooted in Algeria's civil war in the 1990s, into a wealthy and feared militant group that made its money from kidnapping Westerners and trafficking arms and drugs.
In 2007 it announced it had joined the al-Qaeda network to fight against Western interests. Later though, some of its members left to form their own factions. The most notable of these was Mokhtar Belmokhtar who was behind the 2013 siege of a gas plant in Algeria.
In November 2015 Belmokhtar's faction said it had worked with its parent group to attack a hotel in Mali. That signalled the mending of relations between some of the factions to rebuild the original AQIM, which was being overshadowed by its rival, the so-called Islamic State.
This latest attack in Burkina Faso would seem to be an attempt by AQIM not just to reinforce itself as the main jihadist group in the region, but also to show that it can spread its violent campaign to new frontiers. Al-Qaeda in North Africa
Interior Minister Simon Compaore said 10 bodies had been found on the cafe terrace alone.
As the end of the siege at the Splendid was being announced, reports came in that militants had taken up position at the Yibi hotel, a short distance away. One attacker was killed at the Yibi, officials said later.
Remi Dandjinou, the Burkinabe communications minister, told the BBC earlier that between six and seven militants had attacked the Splendid, adding that they had been staying at the hotel as guests.
Mr Compaore said two black Africans and an Arab were among the militants killed. Image copyrightReutersImage caption Burkinabe soldiers ringed the Splendid Image copyrightEPAImage caption French forces also took part in the operation Image copyrightAFP/Getty ImagesImage caption French police officers helped tend to the wounded Burkina Faso recently held its first presidential election since a coup earlier last year.
That coup toppled long-time leader Blaise Compaore, who had governed for 27 years. Are you in the area? Let us know about your experiences. Email haveyoursay@bbc.co.uk with your stories.
Please include a contact number if you are willing to speak to a BBC journalist. You can also contact us in the following ways:
Media captionFires can be seen and explosions heard near the Splendid hotel in Ouagadougou
Gunmen have attacked a hotel used by westerners in Ouagadougou, the capital of Burkina Faso, killing a number of people and taking hostages.
Eyewitnesses said two car bombs went off outside the Splendid hotel at around 19:30 local time (same as GMT).
Three to four masked men then stormed the Splendid Hotel, which is used by UN staff and westerners, witnesses said.
Foreign Minister Alpha Barry confirmed people died and said security forces would launch a raid to free hostages.
Witnesses said the gunman had entered the nearby Cappuccino cafe. One employee at the cafe told Agence France Presse that "several people" had been killed there.
One group that monitors jihadist networks said al-Qaeda in the Islamic Maghreb claimed it was behind the attack.
Eyewitnesses reported hearing exchanges of gunfire between the men and security forces, as well as sporadic gunfire from inside the four-star hotel close to the country's international airport.
At least one car was seen burning outside the building.
Three hours after the attack started, an Associated Press reporter at the scene reported seeing soldiers in an armoured vehicle arrive in the area.
In the latest developments:
Local TV station Burkina 24 says that security forces are preparing to intervene
France's ambassador to Burkina Faso, Gilles Thibault, says a curfew is in place until 06:00 local time
The US embassy in Ouagadougou says it is aware of the incident and is "closely following" the situation
Image copyrightAFP/Getty ImagesImage caption Burkinabe soldiers are stationed outside the Hotel Splendid A similar attack by Islamist militants on a hotel in neighbouring Mali in November left 20 people dead.
Burkina Faso had recently held its first presidential election since a coup earlier last year.
That coup toppled long-time leader Blaise Compaore, who had governed for 27 years.
"We are still in a context of political fragility, so I think the timing of this attack is meaningful," Cynthia Ohayon, an analyst with the International Crisis Group, told the BBC from Ouagadougou.
"The country has long borders with Mali and Niger, and we know there are armed groups present on the border, so this was probably something we had coming." Are you in the area? Let us know about your experiences. Email haveyoursay@bbc.co.uk with your stories.
Please include a contact number if you are willing to speak to a BBC journalist. You can also contact us in the following ways: