Imam Maulana Habib Ur Rehman of Glasgow Central Mosque used the messaging platform WhatsApp to show his support for Mumtaz Qadri.
Qadri was hanged in February after murdering a local politician who opposed strict blasphemy laws.
In a statement the imam said the messages had been taken out of context.
He said that he was expressing his opposition to capital punishment.
In messages seen by the BBC, Imam Maulana Habib Ur Rehman says that he is “disturbed” and “upset” at the news of Qadri’s execution, before writing “rahmatullahi alai”, a religious blessing usually given to devout Muslims and meaning may God’s mercy be upon him.
In another, he says: “I cannot hide my pain today. A true Muslim was punished for doing which [sic] the collective will of the nation failed to carry out.”
Maulana Habib Ur Rehman is the most senior imam at Glasgow Central Mosque, a role which involves leading prayers and giving religious guidance and teachings.