The religious leader at Scotland's biggest mosque has praised an extremist who was executed for committing murder in Pakistan, the BBC can reveal.
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.
The BBC has confirmed with members of the group that the messages come from the imam.
Qadri was employed as a bodyguard for the governor of Punjab province in Pakistan, Salman Taseer, before turning on him in 2011 and shooting him 28 times.
After the shooting Qadri reportedly told journalists that he was "proud" and that he had killed a "blasphemer".
BBC Religious Affairs Correspondent Caroline Wyatt
The support for Qadri expressed in the UK by some Muslims from a group within Islam that is generally regarded as moderate was unexpected.
Those supporting his actions came from within Sunni Islam, and a group known as Barelvis, who control just under 40% of mosques in the UK.
These Sufis are not generally connected with jihadist groups, and present themselves in Pakistan and elsewhere as defenders of a moderate, peaceful Islam.
However, on the day of Qadri's funeral, one of the co-directors of the Association of British Muslims, Paul Salahuddin-Armstrong, was so shocked by comments on social media in the UK praising the killer that he wrote a blog post.
"Horrified… I honestly don't know where to begin," he said.
He said he was also "appalled" to find a prominent mosque in Birmingham - the Ghamkol Sharif - had termed Qadri a "martyr" on its website.
The Barelvis' reverence for the Prophet Muhammad is one of great intensity, and goes back to the founder of their movement, Ahmad Raza Khan Barelvi, in the 19th Century. So the issue of blasphemy is one that is likely to rouse strong emotions among Barelvi wherever they live.
Nonetheless, the public support for a convicted murderer by some of their religious leaders in the UK will worry some observers of Islam here.
Pakistan has some of the strictest blasphemy laws in the world, which can carry a potential death sentence for those judged to have insulted the majority religion of Islam.
Human rights campaigners and liberal politicians, including Taseer, have criticised the laws as draconian and believe that they are abused to target minority groups.
The laws do, however, have mainstream support in the country and an estimated crowd of more than 30,000 people attended Qadri's funeral earlier this month.
Imam Maulana Habib Ur Rehman told the BBC: "The assassination of Salman Taseer is widely condemned.
"Whether I agree or disagree with the views he expressed, as an Imam and as a human being I express abhorrence at the manner in which he was executed.
"The execution was not in accordance with Islamic teachings and principles."
Who was Qadri?
- Trained as an elite police commando and assigned as Salman Taseer's bodyguard
- Shot Salman Taseer 28 times at an Islamabad market in January 2011 and was sentenced to death later that year
- He claimed it was his religious duty to kill the minister
- Qadri was lauded by religious conservatives, and in his first court appearance was showered with rose petals by supporters. He never expressed any regret for the killing
- Hanged on 29 February 2016
Lawyer Aamer Anwar has called for reform at Glasgow Central Mosque.
He told the BBC: "To describe a convicted terrorist as a true Muslim is grotesque.
"Let's be clear: Mumtaz Qadri was a terrorist. He was no national hero and he was no martyr.
"These views expressed are grotesque and whether done privately or publicly they should be condemned unequivocally.
"There's real concern within the community that if this is an imam expressing such views, then what is he expressing to our children."
In further messages, the Imam refers to Qadri as "brother" and says that, by killing his employer whom he was paid to protect, he was "carrying out the collective responsibility of the ummat," or Muslims as a whole.
His execution, he says, "is a collective failure of Pakistani Muslims".
Imam Maulana Habib Ur Rehman is challenged by others in the group who question why he is speaking about a convicted murderer in such glowing terms.
One member argues that Qadri took the law into his own hands and that he should not be made a hero for doing so.
The Imam also likens Qadri's actions to those fighting Nazi occupation during World War Two.
"Just when France was occupied by Nazies [sic], French did all they had to in order to protect their nation," he writes.
"They were national heroes. Hanging Mumtaz Qadri has raised serious questions about Pakistan's independence."
And he links his execution to the issue of Pakistani nationhood.
"The issue is not of an individual. The issue is of national identity and Islamic spirit."
"The fact that the nation chose to settle the issue of Reymond Davis [sic] by forcing his relatives to accept the blood money, and sending Mumtaz bhai [brother] to gallows is a source of grief and immense pain."
Raymond Davis was a contractor with the US Central Intelligence Agency (CIA) in Pakistan.
In 2011, he was arrested and imprisoned in the city of Lahore after he was accused of shooting dead two men, triggering a diplomatic incident between the two countries.
He was released after the families of the two men were paid compensation of $2.3m, which many in the country considered to be "blood money".
The WhatsApp messages are the latest controversy at Glasgow Central Mosque, which is the largest place of worship of any religion in Scotland.
The mosque was plunged into turmoil last month when seven members of its executive committee resigned amid claims of intimidation by more conservative figures at the mosque.
The allegations were denied by those accused.
The Office of the Scottish Charity Regulator (OSCR) is also investigating claims of financial irregularities at the charity which runs the mosque and what it has described as an "unusual" management structure.
Glasgow Central Mosque is governed by two sets of trustees - the executive committee who operate the charity and the property trustees who manage the mosque building.
OSCR's interim report into the mosque in January found the trustees, who are made up of more conservative figures at the mosque, had acted beyond their powers.
There is said to be a long-running contest at the mosque between more traditionalist figures and those, including the seven who resigned, who would like it to be more inclusive of women and non-Pakistani Muslims.
In January, The Herald reported that Glasgow Central Mosque had donated money to the orthodox group Tablighi Jamaat, which some argue promotes an extreme brand of Islam.
The group says that it rejects violence.
Mr Anwar said: "There needs to be diversity, there needs to be equality and they need to open it up.
"We're not living in Pakistan, we're living in Scotland, and we need to see the values and ideas of the people of Scotland [at the mosque]."
In a statement, the imam said: "Mumtaz Qadri's execution is condemned as it is not in accordance with due process nor is it in accordance with Islamic teachings and principles.
"The selective messages disclosed to you by an unauthorised third party have been misconstrued and taken out of context.
"Capital punishment on this particular occasion was inappropriate and any expressions of sympathy or compassion are extended in my capacity as a private individual and not in any professional or public capacity."
Glasgow Central Mosque did not respond to requests for comment.