Nahid Hattar was hit by three bullets outside the court in the capital Amman where he was standing trial.
Police have arrested the suspected shooter, Riad Abdullah. Jordanian media said he was local imam who had been upset by the cartoon.
But security sources told the Jordan Times he was a known extremist.
A witness told the Associate Press news agency that Mr Abdullah had a long beard and was wearing a long robe, common among conservative Muslims.
Nahid Hattar was detained in August for 15 days on charges of insulting God after he published a cartoon depicting a bearded man lying in bed with two women and smoking, asking God to bring him a drink.
Mr Hattar was born a Christian, but considered himself an atheist. He was attacked on social media for being anti-Islam.
He said he had not meant to cause offence and wanted to expose radical Islamists' view of heaven.
Authorities said he had broken the law by sharing the cartoon.
Mr Hattar's supporters say they hold the government responsible for his death.
"The prime minister was the first one who incited against Nahid when he ordered his arrest and put him on trial for sharing the cartoon, and that ignited the public against him and led to his killing," the writer's cousin, Saad Hattar said.
The government has publicly condemned the killing.
A spokesperson told Petra news agency: "The government will strike with an iron hand all those who exploit this crime to broadcast speeches of hatred to our community."
A Jordanian writer charged with offending Islam after allegedly sharing a satirical cartoon on his Facebook page has been killed.