Gunmen have shot dead 18 people and injured others at a cafe in the centre of of the capital of Burkina Faso, Ouagadougou, the government says.
At least eight foreigners and seven locals were among those killed in Sunday's evening attack on the Aziz Istanbul cafe, the government added.
The gunmen, thought to be jihadists, fired on customers on the terrace before making their way inside.
Two attackers were killed in a siege which lasted into the morning.
President Roch Marc Christian Kaboré condemned the "cowardly terror attack", saying the people of Burkina Faso would not give in to terrorism.
The foreigners killed include two Kuwaitis, and one each from Canada, France, Lebanon, Nigeria, Senegal and Turkey, Burkina Faso's Foreign Minister Alpha Barry said. However, Canada's foreign minister said two Canadians had died.
Three victims have not yet been identified, Mr Barry said.
A jihadist attack on a nearby cafe in January of last year killed 30 people.
There are fears that the latest 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) at the cafe, popular with expatriates, on Ouagadougou's busy Kwame Nkrumah Avenue.
Security forces launched a counter-assault at 22:15 and the shooting ended at about 05:00 on Monday.
Police captain Guy Ye told the Associated Press news agency the attackers had arrived on motorcycles and had begun shooting randomly.
One eyewitness told the BBC: "I saw there were multiple trucks or jeeps driving through my street, with... local army/police officers with AK47s, deploying in front of my house.
"I heard a lot of shootings and then I was scared as hell and I went inside. I've been hearing quite a bit of shooting."
Analysis: Alex Duval Smith, BBC News, Dakar
A terrorist attack in the Sahel had been expected.
Residents of Burkina Faso's capital had noticed more police road blocks in the past few days. In neighbouring central Mali, the UN mission, Minusma, had requested that staff and contractors avoid using rural roads.
Burkina Faso is part of the Sahel region, which includes Mali where Islamist groups have been active since 2012.
For nearly two years now northern Mali's terrorist challenge has grown into a regional problem, with attacks by al-Qaeda affiliates in Burkina Faso, Niger and Ivory Coast.
Even though the Ouagadougou attack was not prevented, the fact that Mali and Burkina Faso were on alert suggests Minusma's intelligence-gathering operation is bearing fruit.
France is spearheading fundraising for a regional anti-terror force, the G5 Sahel, which will draw from the armies of Mauritania, Chad, Burkina Faso, Mali and Niger.
The force will not be operational until later this year.
French President Emmanuel Macron condemned the attack and discussed the situation with his Burkinabe counterpart, Roch Marc Kabore, his office said.
The attack is similar to one in January 2016, when gunmen targeted the Splendid Hotel and the Cappuccino restaurant, only 200m further along Kwame Nkrumah Avenue from the scene of the latest attack.
More than 170 people were taken hostage and 30 were killed. The al-Qaeda in the Islamic Maghreb (AQIM) group said it had carried out that attack.
Under fire: Recent attacks in Burkina Faso
- December 2016: 12 soldiers die in an attack by Islamist militants in the north, near the Mali border
- January 2016: Islamist militants attack an Ouagadougou hotel popular with foreigners (above). Western nationals are among 30 people killed in the country's deadliest attack so far
- March 2017: As the capital gears up for Fespaco film festival, two police posts in the north are attacked. Three people are killed
- March 2017: Two people are kidnapped and a school is torched after jihadists threaten educational establishments