Al Qaida fighters who stormed a luxury hotel and a cafe in Burkina Faso's capital had a mission to kill as many people as possible, survivors and authorities have said.

When the gunfire stopped after a siege lasting more than 12 hours, at least 28 people had been murdered in an unprecedented attack on the west African country long spared the jihadist violence experienced by its neighbours.

Like the extremist attacks from Paris to Jakarta, Indonesia, the assailants targeted an area where foreigners gathered to enjoy life.

In Ouagadougou, the victims had been grabbing a cold drink outside or staying at one of the capital's few luxury hotels and in this city with a large aid worker presence, the attackers sought to shoot as many non-Muslims as possible, screaming "Allahu akhbar"(Arabic for God is great) as they entered.

An audio tape later released by the al Qaida group claiming responsibility for the carnage was entitled A Message Signed with Blood and Body Parts.

Victims from 18 countries included the wife and five-year-old daughter of the Italian man who owns the Cappuccino Cafe, where at least 10 people died in a hail of gunfire and smoke after the attackers set the building ablaze before moving on to the Splendid Hotel nearby.

Some survivors cowered for hours on the roof or hid in the restaurant's toilet to stay alive. Two French, six Canadians and two Swiss were among the dead, as well as American missionary Michael Riddering, 45, of Cooper City, Florida, who had been working in Burkina Faso since 2011.

Mr Riddering was about to meet a group planning to volunteer at the orphanage and women's crisis centre he ran with his wife Amy.

The four known attackers, all killed by security forces, had come in a vehicle with plates from neighbouring Niger. At least two of them were women and one was of African descent. Witnesses said they wore the turbans often worn in the sand-swept countryside of the Sahel and some spoke in French with an Arabic accent, suggesting some may have come from further north in Africa.

"I heard the gunfire and I saw a light by my window and I thought it was fireworks at first," said Rachid Faouzi Ouedraogo, 22, an accounting student who lives near the scene of the carnage.

"I raced downstairs and once outside I saw people running through the street and four people firing on the people at Cappuccino."

Burkinabe forces backed by French soldiers based in neighbouring Mali helped free at least 126 hostages though officials have said the true number of those held hostage may be higher. Dozens were wounded in the overnight siege.

"We appeal to the people to be vigilant and brave because we must fight on," President Roch Marc Christian Kabore said on national radio.

The North Africa branch of al Qaida, founded in Algeria, said it carried out the bloodbath even as it was unfolding in a series of statements published and translated by the SITE Intelligence Group.

The al Qaida affiliate known as AQIM - now working in tandem with feared extremist Moktar Belmoktar - later released an audio clip it said was a conversation with one of the fighters later killed in Ouagadougou.

The message said the attack was directed at "the occupiers of our lands, the looters of our wealth, and the abusers of our security", according to SITE, and sought to punish them "for their crimes against our people in Central Africa, Mali, and other lands of the Muslims, and to avenge our prophet".

Burkina Faso is a largely Muslim country though it is home to a number of French nationals as a former colony of France. Islamic extremists in the region have long targeted French interests, incensed by France's military footprint on the continent more than half a century after independence.

France led the military effort in 2013 to oust extremists from their seats of power in northern Mali and continue to carry out counter-terrorism activities across the Sahel region.

French special forces were also involved as police and troops fought to take back the Splendid Hotel. After freeing the hostages there, they scoured other buildings including the Hotel Yibi where they killed the fourth attacker, the president later said.

The horror closely mirrored the siege of a top hotel in Bamako, Mali, in November that left 20 people dead and shattered the sense of security in the capital of a nation whose countryside has long been scarred by extremism.

Burkina Faso was better known for the role its president and officials played in mediating hostage releases when jihadists would seize foreigners for ransom in places like Niger or Mali. Now though, it appears Burkina, too, has been turned into a place where Westerners are at high risk.

Australia's department of foreign affairs and trade said an elderly Australian doctor and his wife, identified in news reports as surgeon Ken Eliot and his wife Jocelyn, had been kidnapped in Burkina Faso's north. The two were abducted from the town of Djibo near the border with Mali.

The couple, in their 80s and originally from Perth, have lived in Djibo, near Baraboule, since 1972, and work in a volunteer medical clinic which they built, reports said.

Jihadists are also holding a third foreigner - a Romanian kidnapped in an attack last April that was the first of its kind at the time.

The Dutch foreign minister has revealed that a 67-year-old Dutch man was among those killed in Burkina Faso.

Bert Koenders said the victim was volunteering in the West African nation.

He gave no further details, but said it was "painful and bitter that somebody who wanted to contribute to the development of the country has fallen victim to such a deed".

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.