West Africa's arid Sahel region is suffering a spike in violence by terrorist groups, some with links to al Qaeda and ISIS, that is drawing an increasingly aggressive response from countries including France and the United States.
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 terrorists.
"Everything suggests that this attack was carried out by terrorist groups," Jean-Yves Le Drian told LCI television. "France is determined to relentlessly fight these terrorist groups that want to destabilise the (West Africa) region and who are a serious danger to our security and interests."
Burkinabe state television said the unidentified gunmen killed five soldiers and wounded 64 at the military headquarters. Two members of Burkina Faso's paramilitary gendarmes were killed defending the embassy. President Roch Kabore tweeted that the death toll had risen to eight.
Le Drian said that there were "numerous" Burkinabe victims at the army headquarters, but that no French nationals had been killed in the simultaneous attacks.
The national police said in a statement that eight gunmen were killed: four at the embassy and four at the army headquarters. Two attackers were captured, according to military source and state television.
Witnesses said masked gunmen attacked the downtown army headquarters at around 10 a.m. (1000 GMT).
"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 soldiers and armoured vehicles took up positions in the area.
A Reuters reporter saw an ambulance entering the army compound.
France's defence ministry said French special forces, which have a base in the country, were used to protect French citizens and secure the embassy.
Police also took up positions near the offices of the prime minister where gunfire was also reported.
A Reuters reporter said gunfire had largely ceased by noon.
The French targets attacked are symbolic given that President Emmanuel Macron chose to outline his Africa strategy, including the fight against terrorists, in Ouagadougou in November.
Burkina 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.
Macron, who spoke to President Kabore by phone, condemned the attack and said Paris was fully committed to the region, where France has some 4,500 soldiers as part of a counter-terrorism force since it intervened against terrorists in Mali in 2013.
Islamist groups 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 terrorists 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 - backed by France, launched a new taskforce last year to tackle Islamist terrorists in the region, to which international donors have committed half a billion dollars.
(Additional reporting by Aaron Ross in Dakar, Souleymane Ag Anara in Niamey and John Irish, Emmanuel Jarry, Jean-Baptiste Vey, Sophie Louet and Richard Lough in Paris; Writing by Joe Bavier, Edward McAllister and John Irish; Editing by Matthew Mpoke Bigg)
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)