A man has been jailed for 27 years for the brutal knife murder of a much-loved shopkeeper at his store.

Tanveer Ahmed, 32, from Bradford, West Yorkshire, appeared at the High Court in Glasgow last month when he pleaded guilty to murdering Asad Shah outside his newsagents in the south side of the city in March.

The killer returned to the dock on Tuesday to learns his fate and was sentenced to life in prison with a minimum of 27 years for the "barbaric and wholly unjustified act".

He raised his fist and shouted in court "the Prophet is great, there is only one Prophet" as he was jailed and led away by guards while many supporters in court shouted the same.

Judge Lady Rae said: "I accept this killing was not motivated by feelings toward the Ahmadiyya community. But it was religiously motivated."

Ahmed's QC told the court he was a "law abiding citizen" who was well regarded in his community before the murder of Mr Shah, which shocked his local community of Shawlands as well as Scotland as a whole.

Lawyer John Rafferty said his client did not come to Glasgow intending to kill the shopkeeper but "lost it" after something "disrespectful" was said.

The judge described the murder as an "appalling display of merciless violence", adding: "I note with considerable concern you have shown no remorse ... it is clear you are proud of what you did."

Mr Shah was left with a broken jaw, broken nose and cheek bones. The assault was so severe he also suffered a fractured skull to an extent more often seen in victims of car crashes.

Ahmed drove 200 miles from his home town to Minard Road in Shawlands, where he launched the attack on the shopkeeper on March 24.

During the journey, he watched online footage of fellow Muslim Mr Shah and made the comment "something needs to be done, it needs nipped in the bud".

He was referring to videos posted on Mr Shah's Facebook page, including one in which he claimed to be a prophet. This is seen as blasphemy by many Muslims as Prophet Muhammad is viewed as the final prophet.

Two days before the murder, the killer stayed overnight with a local man who was a mutual friend and who had offered him a place to stay. That man knew Asad Shah.

Ahmed returned to Bradford the following morning and said he would come back to Glasgow the next day.

After driving the 200 miles in his Uber private hire car to Mr Shah's shop on March 24, he walked in at around 9pm and started speaking to him. Mr Shah offered his hand to his killer but this was refused.

Ahmed then pulled a blade from his robes and launched a frenzied knife attack on Mr Shah. His brother then tried to help and they spilled out of the shop on to the street.

The blows from Ahmed continued even after the brother tried to wield a newspaper advertising board to fend off Ahmed.

Shop assistant Stephen McFadyen then grabbed it from the killer and put it in bushes out the way before Ahmed began punching, kicking and stamping with full force on Mr Shah.

The attack then stopped suddenly and Ahmed walked calmly to a bus shelter nearby where he sat, head bowed as if in prayer. He made no attempt to escape.

Police attended and found a bloodied Ahmed, who told them where the knife was and that he had no other weapons on him.

Before the next day, the killer was interviewed under caution and explained he had acted alone and his actions were motivated by Asad Shah's decision to "disrespect the Koran, the Prophet Mohammed, Allah and Faith".

He said he had warned Asad Shah he was there to kill him and asked him to stop claiming to be a prophet but that he had insisted he was.

A statement on behalf of the Shah family said: "Asad's family have have lost a peaceful, kind and loving brother, son and uncle who can never be replaced.

"Most of his family have now left or are in the process of leaving Scotland, a country they came to seek safety in.

"They are grateful to the lord advocate, Crown Office and Police Scotland for their hard work and compassion.

"For those who choose to speak on behalf of Asad, his family say they have no permission to do so and request their privacy is respected."

In the wake of Mr Shah's murder the Scottish Government is to review the law covering religiously aggravated crimes.

The Crown Office decided the circumstances of the killing in March did not meet the "statutory test for an offence to be aggravated by religious prejudice" but Lord Advocate James Wolffe QC has now written to the Justice Secretary as he believes the case highlighted a "potential gap" in legislation.

If charged with an offence aggravated by religious prejudice, Tanveer Ahmed could have faced a longer minimum sentence.

The Cabinet Secretary for Justice Michael Matheson told STV News: "There may be a potential gap within the legislation at the present moment.

"I think he's raised a very important issues and as a government we are now going to consider that very carefully and if necessary we will bring forward legislation to address this very issue that the Lord Advocate has raised."