Attackers in Burkina Faso's capital killed seven people and wounded some 50 others in a coordinated assault on the army headquarters and French embassy that a French ambassador said was a terrorist attack.
There was no immediate claim of responsibility for the attack, which is the third major assault on Ouagadougou in just over two years.
Previous attacks were conducted by allies of al-Qaeda in reprisal for Burkina Faso's participation in a regional fight against Islamist militants.
Speaking on state television, government spokesman Remi Dandjinou said the unidentified gunmen killed five Burkinabe soldiers and wounded around 50 others at the military headquarters. Two members of Burkina Faso's paramilitary gendarmes were killed defending the embassy, he said.
An emergency medical post was established at the municipal stadium.
A government statement said four gunmen were "neutralised" at the French embassy. The Defence Minister said three assailants were killed at the army headquarters.
The police said one member of the group, who had attempted to flee near the city's main market, was being surrounded by security forces.
A French diplomatic source said that no French nationals were killed in the attacks.
Witnesses said masked gunmen attacked the downtown army headquarters at around 10am.
"I saw people with sacks on their backs attack the guard. Then I heard the explosion. I saw soldiers flee the army headquarters building running," witness Kader Sanou told Reuters.
The explosion inside the headquarters shook surrounding buildings, set the compound on fire and sent up a thick column of black smoke.
Panicked residents fled the city centre on foot or motorbikes as dozens of Burkina Faso special forces and armoured vehicles took up positions in the area.
A Reuters reporter saw an ambulance entering the army compound.
Attack on the French
Around two kilometres away the French embassy also came under attack. Police also took up positions near the offices of the Prime Minister where gunfire was also reported.
"Burkinabe security forces are mobilized against the attackers with the support of security forces at our embassy," said French Foreign Minister Jean-Yves Le Drian in a statement.
An aide to Le Drian later said the diplomatic compound and Ouagadougou's French cultural institute, which the embassy had earlier said was involved in the attack, were no longer in danger.
A Reuters reporter said gunfire had largely ceased by noon.
The French targets attacked are symbolic given that French President Emmanuel Macron chose to outline his Africa strategy, including the fight against militants, in Ouagadougou in November.
Burkina Faso is a former French colony and, like several others countries in west and central Africa, retains close security and trade links with Paris. The landlocked country of around 19 million exports cotton and gold.
Mr Macron was being kept up to date with events in Ouagadougou, the Elysee Palace said in a statement.
Jean-Marc Châtaigner, France's ambassador to West Africa's Sahel region, tweeted:"Terrorist attack this morning in Ouagadougou, Burkina Faso: solidarity with colleagues and Burkinabe friends." He urged people to avoid the city centre.
New wave of attacks
Islamist militants have stepped up attacks in major cities in West Africa the last few years, including deadly assaults in Mali, Burkina Faso, Ivory Coast and Niger.
Suspected jihadists killed at least 18 people last August during a raid on a restaurant in Ouagadougou, and militants have targeted Burkinabe security forces along its remote northern border region with Mali.
Al-Qaeda in the Islamic Maghreb (AQIM) claimed responsibility for an attack on a restaurant and hotel in Ouagadougou in January 2016 in which 30 people were killed.
Five countries - Burkina Faso, Niger, Chad, Mali and Mauritania - launched a new taskforce last year to tackle Islamist militants in the arid Sahel region, to which international donors have committed half a billion dollars.
France which has some 4,000 troops in the region as part of a counter-terrorism force, has bemoaned that the militants have scored military and symbolic victories in West Africa while the G5 force has struggled to win financing and become operational.