By Mathieu Bonkoungou and Nadoun Coulibaly

OUAGADOUGOU (Reuters) - Security forces in Burkina Faso battled suspected Islamist fighters late on Friday who were holding hostages at a hotel used by foreigners in the capital, Ouagadougou, gendarmes and witnesses said.

The attack, claimed by al Qaeda in the Islamic Maghreb (AQIM), would be the first by Islamist militants in the capital of Burkina Faso. It follows a deadly raid on a hotel in Mali last November as well as attacks by militants in other countries in West Africa.

The gunmen stormed the five-story Splendid Hotel in Ouagadougou's business district, burning cars outside and firing in the air to drive back crowds before security forces arrived, prompting an intense exchange of gunfire.

Some of the wounded arrived at a local hospital, but there were so far no confirmed reports of deaths.

The hotel is sometimes used by French troops with Operation Barkhane, a force based in Chad and set up to combat Islamist militants across West Africa's vast, arid Sahel region.

"It is continuing at this time. We are trying to know how many attackers they are to better coordinate our actions," said a senior official with the national gendarmes who asked not to be named. "Hostages have been taken. The operation could take several hours."

A Reuters witness saw gunmen emerge from the hotel and fire into the air. A vehicle carrying security personnel arrived and shortly afterward an intense gun battle began.

"We had just opened and there were a few customers we started to serve when we heard gunshots ... There were three men shooting in the air," said Vital Nounayon, a waiter at a restaurant across the street from the hotel.

"Lots of people left their cars and motorcycles and ran. They (attackers) set fire to the vehicles. They also fired on the Capuccino Restaurant across from the hotel before setting it on fire," he said, adding that the attackers wore turbans.

Amateur video footage showed a burning car on an empty street in front of the hotel. Gunfire and explosions could be heard.

Story continues

The landlocked West African state has endured political turmoil since October 2014 when longtime President Blaise Compaore was overthrown during mass protests and elite troops launched a one-week coup in September 2015.

But it has been largely spared violence by Islamist militants, who have staged attacks in Mali, a country with which it shares a 600-km (375-mile) border.

WARNING SIGNS

Burkina Faso, which produces gold and cotton, is diverse in religious terms and has a population that is around 60 percent Muslim, according to government figures.

The attack presents a significant challenge to President Roch Marc Kabore, who was elected in November 2015 as Burkina Faso's first new leader in decades.

Earlier, the Ministry of Defence issued a statement saying that about 20 armed men killed a gendarme and a civilian in an attack on the village of Tin Abao in northern Burkina Faso. It was unclear whether the attack was by militants.

The French Embassy in Ouagadougou issued a statement on its website telling its citizens not to go outside and said it was setting up a crisis unit. The country gained independence from France in 1960.

French Ambassador Gilles Thibault said he had been informed that a curfew is in place from 11 p.m. local time (2300 GMT) to 6 a.m. The Foreign Ministry in Paris said it was assessing the situation. France has up to 200 special forces troops in the country.

The embassy in December warned French citizens against traveling to a national park in eastern Burkina Faso after reports that Malian jihadists were threatening to kidnap foreigners.

An Islamist militant group Al-Mourabitoun said in May 2015, it was holding a Romanian man kidnapped from a mine in northern Burkina Faso the previous month.

Around 50 unidentified gunmen attacked a Burkina Faso gendarmerie brigade near the country's western border with Mali in October 2015, killing three in an attack the then government blamed on the leaders of a failed coup one month before.

Islamist militants have staged attacks in a number of West African states bordering the Sahel in recent years.

Two militants killed 20 people from nations including Russia, China and the United States at a luxury hotel in Mali's capital on Nov. 20, 2015, before being killed by the security forces.

Three Islamist groups including al Qaeda in the Islamic Maghreb claimed responsibility for that attack, the most prominent by militants who are based in the north of the country and have staged a series of attacks over the last year.

Boko Haram have killed thousands in northeastern Nigeria during a six year insurgency and in 2015 extended its attacks into neighboring countries Chad, Niger and Cameroon.

(Additional reporting by Brice Makini in Dakar, Joe Bavier in Abidjan and John Irish in Paris; writing by Matthew Mpoke Bigg, editing by G Crosse)