Amman: A Jordanian court on Tuesday sentenced to death a man accused of killing a Christian writer outside an Amman court in September over a cartoon deemed offensive to Islam.

Nahed Hattar was hit by three bullets on the steps of the court where he had been on trial for allegedly insulting Islam after he shared a cartoon on social media that mocked Islamists.

His 49-year-old killer, Riad Esmail, a computer engineer who worked for the education ministry, was arrested at the scene and charged with premeditated murder, terrorism and possession of an illegal firearm.

On Tuesday, Esmail appeared before the military court, bearded, handcuffed and wearing a brown prison uniform to hear the judge at the state security court sentence him to “death by hanging”.

Judge Ziad Al Edwan said he was sentenced “for having carried out deadly terrorist act, incitement, premeditated murder and illegal possession of a firearm”.

Esmail responded by saying: “Allah suffices me because he is the best disposer of affairs” — a traditional Muslim phrase used by people who feel they have been wronged and consider that only God’s judgement counts.

The court also sentenced the man who sold Esmail the gun and the man who introduced him to the weapon merchant to one year in jail each.

Hattar, a 56-year-old leftist writer, was arrested on August 13 after posting a cartoon on Facebook under the title “God of Daesh” (the Daesh group). He was later released on bail.

It showing a bearded man in bed smoking with two women lying on either side, and addressing God as a servant.

He explained on Facebook that the cartoon made fun of “terrorists and how they imagine God and heaven, and does not insult God in any way”.

He was gunned down on September 25.

His murder, which King Abdullah II branded a “heinous crime”, sparked protests in Jordan, with demonstrators calling on the government to resign.