A Mauritanian extremist told a trial in Mali on Wednesday that he had attacked a club in the capital Bamako in 2015, killing five people, in revenge for cartoons of the Prophet Mohammed by France’s Charlie Hebdo magazine.

A Frenchman, a Belgian and three Malians were killed in the March 2015 attack, when gunmen sprayed the Terrasse bar and restaurant with bullets, one of two deadly attacks targeting Westerners in Bamako that year.

“We are the ones who carried it out, Al-Mourabitoune,” exclaimed Fawaz Ould Ahmed, also known as “Ibrahim 10,” referring to a prominent jihadist group in the Sahel.

“We are not ashamed, we are proud,” he said.

“It was revenge for the prophet after what they did at Charlie Hebdo — it’s the photos, the caricatures.”

He added: “And sadly, it’s not over. It’s still continuing,” in an apparent reference to French President Emmanuel Macron defending the right to mock religion after a teacher was murdered near Paris for showing his pupils the cartoons.

Macron’s comments have stoked anger in the Muslim world, with protests and boycotts of French products in a number of Arab countries.

Ould Ahmed and two other men, Malian nationals Sadou Chaka and Abdoulbaki Abdramane Maiga, have been charged both for the La Terrasse attack and for another assault in November 2015, when gunmen took guests and staff hostage at the 190-room Radisson Blu hotel.

Ould Ahmed, believed to be aged about 40, is allegedly a lieutenant of the notorious one-eyed Algerian jihadist Mokhtar Belmokhtar.

He is accused of personally shooting the victims at La Terrasse with an assault rifle.

Ould Ahmed said he went into the toilets at the club to don a hood and get out his Kalashnikov and then shot at people.

He said he was surprised he was able to return home by taxi without a hitch after the attack.

In January 2015, Islamist gunmen in Paris killed 12 people at the offices of Charlie Hebdo, a weekly satirical magazine, over the publication of the Prophet Mohammed caricatures.

Millions of people in France took part in demonstrations in support of the stricken publication.

Ould Ahmed, who is also accused of masterminding the Radisson Blu attack, was arrested in April 2016 by Malian police in Bamako, where he had arrived more than a week earlier to prepare further assaults, according to a source close to the investigation.

The siege left 20 people dead, including 14 foreigners.

The trial in Bamako is a rare event in the Sahel, where weak and impoverished states are floundering in the face of a bloody jihadist revolt.

The insurgency in Mali first emerged in the north in 2012, before spreading to the centre of the country and from there to neighbouring Burkina Faso and Niger.

Thousands of soldiers and civilians have died, and hundreds of thousands have fled their homes.