Nouakchott: 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.

Mohammad Shaikh, 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.

Shaikh 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 Mohammad and his companions during holy wars, the source said on condition of anonymity.

During his trial, the judge told Shaikh 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.

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

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.

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 had demonstrated in front of the presidential palace to express their outrage against Shaikh.

President Mohammad Ould Abdul 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”.