A prominent Jordanian writer has been shot dead in front of the courthouse where he was on trial for sharing a cartoon deemed offensive to Islam.

Police and relatives say Nahed Hattar was gunned down shortly before arriving for a court hearing in Amman.

Police said the killer was arrested at the scene.

Mr Hattar was arrested in August after sharing the cartoon on social media. The drawing, of unclear origin, depicts God in paradise, being treated as a servant by an Arab man lounging in bed with two women and asking for wine.

Relatives said the cartoon was meant to illustrate what Mr Hattar, a Christian, viewed as the twisted religious views of Islamic State extremists.

The post was quickly deleted after many angry responses.

Jordan is an overwhelmingly Muslim and deeply conservative country.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.