Ouagadougou (AFP) - At least 20 people have been killed and others were being held hostage in an ongoing Al-Qaeda attack on a hotel in the capital of Burkina Faso popular with United Nations staff and westerners.

A fire raged in the main entrance of Ouagadougou's four-star Splendid hotel and screams could be heard from inside as Burkinabe forces prepared an assault to rescue hostages still trapped five hours after the assault began.

Officials said French forces could join a counter-attack on the hotel, while a US defence official said Washington would potentially provide surveillance.

The attack comes less than two months after a jihadist hostage siege at the luxury Radisson Blu hotel in the Malian capital Bamako in November, in which 20 people died including 14 foreigners.

"We know that there are victims and there are hostages. Currently the area is blocked by security forces waiting for an assault to free the hostages," Foreign Minister Alpha Barry told AFP.

Around 10 vehicles were on fire in the streets near the hotel in Ouagadougou, not far from the city's international airport.

The head of the city's main hospital confirmed at least 20 dead and another 15 injured, and witnesses said the assailants were still holed up in the 147-room hotel.

A restaurant opposite the hotel was also attacked and a staff member, reached by telephone, said several people had been killed, but was not able to give an exact toll.

- Sporadic fire -

Al-Qaeda in the Islamic Maghreb (AQIM) claimed responsibility for the attack, according to US-based monitoring group SITE.

The "mujahideen brothers" of AQIM "broke into a restaurant of one of the biggest hotels in the capital of Burkina Faso, and are now entrenched and the clashes are continuing with the enemies of the religion", SITE quoted the group as saying.

Sporadic exchanges of fire could be heard between the attackers and security forces near the hotel, which often has UN staff among its guests and has security checks at its entrances. Firefighters were also at the scene.

Story continues

Barry said Burkina Faso may enlist the support of French special forces, who have a permanent presence in the country, to deal with the unfolding situation, and a US defence official, speaking on condition of anonymity, said Washington could provide drone-based surveillance.

An AFP reporter at one point saw three men clad in turbans firing at the scene on Avenue Kwame Nkrumah, one of Ouagadougou's main thoroughfares.

A witness also reported seeing four assailants who were of Arab or white appearance and "wearing turbans".

The French embassy said on its website that a "terrorist attack" was underway and urged people to avoid the area. An Air France flight from Paris to Ouagadougou was diverted to neighbouring Niger.

The Burkinabe army meanwhile revealed that an armed group had carried out an attack earlier in the day near the border with Mali, killing two people.

"In the afternoon around 2:00 pm (1400 GMT), around 20 heavily-armed unidentified individuals carried out an attack against gendarmes in the village of Tin Abao," the army said in a statement, adding that an officer and a civilian had been killed and two people were wounded.

- Unprecedented attack -

Several attacks have taken place in Burkina Faso in recent months, but no such assaults have yet hit the capital.

In April the Romanian security chief of a mine in northern Tambao was kidnapped in a move claimed by Al-Murabitoun, a jihadist group run by notorious Algerian militant Mokhtar Belmokhtar.

Al-Murabitoun claimed November's Mali hotel attack -- although another jihadist group from central Mali has also said it was responsible for the siege in which some 150 staff and guests were held hostage for several hours.

Burkina Faso is part of the G5 Sahel grouping that counts the fight against terrorism as part of its remit.

It has also offered support to France's Barkhane counter-terror mission, spanning five countries in Africa's restive Sahel region, and French special forces are stationed in Ouagadougou's suburbs.

Last month, Burkina Faso swore in Roch Marc Christian Kabore as president, completing the troubled West African state's transition after the overthrow of its longtime ruler Blaise Compaore in 2014 and a failed coup attempt in September.