Hattar was arrested after he shared a caricature that depicted a bearded man in heaven smoking in bed with women and asking God to bring him wine and cashews
A gunman shot dead Jordanian writer Nahed Hattar on Sunday outside the court where he was to stand trial on charges of contempt of religion after sharing on social media a caricature seen as insulting Islam, state news agency Petra said.
It said the gunman was arrested at the scene.
Hattar, a Christian and an anti-Islamist activist who was a supporter of Syrian President Bashar al-Assad, was arrested last month after he shared a caricature that depicted a bearded man in heaven smoking in bed with women and asking God to bring him wine and cashews.
Many conservative Muslim Jordanians considered Hattar's move offensive and against their religion. The authorities said he violated the law by sharing the caricature.
The state news agency quoted a security source as saying Hattar was killed by a man who fired three shots at him on the steps of the palace of justice in the Jordanian capital.
"The assailant was arrested and investigations are ongoing," Petra quoted the security source as saying.
Two witnesses said the gunman, bearded and in his '50s, was wearing a traditional Arab dishashada, worn by ultra conservative Sunni Salafis who adhere to a puritanical version of Islam and shun Western lifestyles.
Hattar had apologized and said he did not mean to insult God but had shared the cartoon to mock fundamentalist Sunni radicals and what he said was their vision of God and heaven. He had accused his Islamist opponents of using the cartoon to settle scores with him.