Gunmen have launched an attack in the capital of Burkina Faso, Ouagadougou, with the French embassy and a military HQ among the apparent targets.

Burkina Faso's government said four attackers had been killed at the embassy and at least two at the HQ.

A number of troops and police officers have been wounded but no civilian casualties have been reported so far.

A French diplomatic source quoted by Agence France-Presse said the situation at the embassy was now under control.

It is unclear who is behind the violence but Burkina Faso Information Minister Remis Fulgance Dandjinou told state TV the attack had "strong overtones of terrorism".

Pictures from the scene showed a cloud of black smoke rising into the sky. Witnesses reported seeing armed men getting out of a car and opening fire before heading towards the embassy.

Sporadic gunfire can still be heard and the Burkinabe police said one attacker had been surrounded at the city's main market.

Ouagadougou Mayor Armand Béouindé told France's Le Monde newspaper that the attackers shot at the town hall and his office windows were shattered. "Apparently, it is a jihadist attack," he said, but gave no further details.

One witness, Omar Zombre, told local TV: "We saw four people who were trying to enter the embassy on the east side. They were in civilian attire, with a kind of vest and backpacks with Kalashnikovs which were clearly visible.

"So they tried, but they didn't manage it and so they tried to enter from the west side. We saw that they had set a car on fire. When we went up [to the roof] we heard gunshots from an automatic weapon, [it was] very intense."

French President Emmanuel Macron was being kept up-to-date, said the Elysée Palace in Paris. He has urged French nationals in the country to follow the embassy's advice and stay away from troubled areas.

French forces based in the country have also been deployed.

French Foreign Minister Jean-Yves Le Drian told LCI TV there were "no French casualties, as far as we're aware".

The city's military HQ and the embassy - which is also near the prime minister's office - are about one kilometre apart. Local TV said the PM was safe.

The US embassy in the city has advised people to seek shelter.

Ouagadougou has suffered two major attacks by Islamist militants in the past two years.

The West African country also saw a failed coup in 2015. The trial for dozens of the alleged perpetrators began earlier this week but was suspended after defence lawyers walked out in protest against the military court.