Nouakchott (AFP) - Mauritania has delivered its first death sentence for apostasy since independence in 1960, ordering capital punishment for a Muslim man who wrote an article deemed blasphemous of Islam.

Mohamed Cheikh Ould Mohamed, aged in his late 20s, fainted when the ruling was read out late Wednesday in a court in Nouadhibou in the northwest of the country, a judicial source told AFP.

He was revived and taken to prison.

Cheikh Ould Mohamed has been in custody since January 2, after his arrest for an article he wrote that appeared briefly on several Mauritanian websites.

His text challenged some decisions taken by Islam's prophet Mohammed and his companions during holy wars, the source said on condition of anonymity.

During his trial, the judge told Cheikh Ould Mohamed he was accused of apostasy "for speaking lightly of the Prophet Mohammed".

The defendant pleaded not guilty and said it was "not his intention to harm the prophet," the judicial source said.

No information was immediately available on whether he would appeal.

Local Islamic organisations said it was the first time a text critical of Islam had been published in the country.

Jemil Ould Mansour, the head of the moderate Islamist Tewassoul party, on Thursday hailed the ruling, saying: "It's the story of a criminal who got the fate he deserved."

Mauritania upholds the strict Islamic law known as Sharia. But it has not meted out the harshest punishments provided under that law, such as executions and floggings, for nearly three decades.

The west African country last executed a prisoner in 1987, according to Amnesty International. Capital punishment is mainly reserved for murder and acts of terrorism.

In his article, Cheikh Ould Mohamed, named by some local media outlets as Cheikh Ould Mohamed Ould Mkheitir, claimed "an iniquitous social order" was being perpetuated in Mauritania, with an underclass that was "marginalised and discriminated against from birth" and to which he belonged.

Story continues

His court-appointed lawyers had asked for leniency on the grounds their client was repentant.

But the judge agreed to the prosecutor's request for the death penalty, ruling that the country's criminal statutes called for capital punishment for any Muslim "who has renounced Islam explicitly or through acts or words in that sense".

The verdict was met with shouts of acclaim from the court's public gallery, while on the streets there were jubilant scenes as cars sounded their horns.

In January 2014, after the article appeared, tens of thousands of protesters demonstrated in front of the presidential palace to express their outrage against Cheikh Ould Mohamed.

President Mohamed Ould Abdel Aziz responded by urging calm and telling the protesters he would take "all necessary measure to defend Islam and its prophet".

Islam, he added, "is above everything, above democracy and freedom".