A Saudi trial based "heavily on Koranic law" has resulted in a death sentence for a 'mentally ill' man who denounced the Islamic 'prophet' Mohammed.

Ahmad Al-Shamri was arrested in 2014, the Washington Post reported, and activists from Human Rights Watch have been trying to find information about the specifics of his case since then.

The Post noted that Saudi Arabia "routinely tries to hide capital trials and death sentences from the outside world".

Some Twitter users celebrated the death sentence as Al-Shamri's name trended on the site. One said it was "fine" to be an atheist, unless you "talk in public" or "criticize God or religion, then you shall be punished."

Another said that unless he recanted after being asked three times "kill him".

"I wish there will be live streaming when you cut his head off," one tweet read.

The tweets were translated by @Faris_dream, an ex-Muslim atheist from Saudi Arabia.

Bob Churchill of the International Humanist and Ethical Union, to which the NSS is affiliated, said: "Once again, this judgement shows how vanishingly little tolerance the Saudi authorities have for difference of opinion, or for freedom of thought."

The verdict revealed the falsity of their pretence at respecting human rights, he said, "And it shows that the lives of the non-religious are held in contempt and valued as worthless."

"We have seen in countries such as Bangladesh, Pakistan, India and the Maldives the murder of humanists and liberals by extremist gangs."

The barbarity was no different when it came from extremist nation states, Mr Churchill added. "By upholding this sentence, Saudi Arabia proves itself an extremist state.

"As an urgent step toward upholding their human rights commitments, we call on the Saudi government to pardon and release Al Shamri, to ensure his protection upon release, and to fundamentally revise these outrageous, inhuman laws."

There have been constant killings throughout the Islamic world targeting atheists and apostates, including the mob killing of Mashal Khan, a university student in Pakistan after he was accused of blasphemy.

The Guardian reported that the university investigation initially focused on whether Khan had blasphemed or not instead of the mob violence that killed the 23-year-old.

Unusually for Pakistan there were demonstrations supporting Khan after the killing.

But shortly after he was murdered, three women shot a 50-year-old, Fazal Abbas, after he was accused of blasphemy.

Around the same time, the Independent reported, a mob attempted to murder a mentally ill man inside a mosque after he claimed God had appointed him as the religious leader of all Muslims.