Two men who left a shopkeeper with a fractured skull after he was attacked with a machete in a robbery bid have been jailed.

Liam McMeechan was sentenced to seven years following the attack at A&A Newsagents on South Trinity Road, Edinburgh last August.

McMeechan was originally charged with attempting to murder shopkeeper Tahir Ahmed but the Crown accepted his plea to a reduced charge of assaulting the victim to his severe injury and permanent disfigurement.

His sentence will begin in April 2018 as he carried out the raid while on early release for an earlier crime.

His accomplice David Allan, 50, of Edinburgh, admitted attempting to rob the shopkeeper during the attack on August 12 last year.

He was sentenced to 32 months at the High Court in Glasgow on Friday.

During the attempted robbery Mr Ahmed tried to fight off McMeechan, who had demanded money from the shopkeeper.

The 54-year-old had been working alone at the time and pressed the silent alarm.

In the struggle, he was hit twice in the head with a machete.

Mr Ahmed used a chair to fend of McMeechan, throwing it at the 23-year-old attacker. He eventually fled empty-handed from the shop, leaving the machete behind.

The shopkeeper realised after a few minutes that he was bleeding from his head and sought help from a nearby pharmacy.

He was taken to hospital where he had 18 staples put in his forehead.

Speaking to STV News, Mr Ahmed told of the physical and mental toll the attack had taken on him.

He said: "I could have been paralysed or dead.

"The physical side is getting better by the psychological side will take some time because I'm always nervous, especially in the winter when it's quite dark in the morning and quite dark in the evening.

"I'm always on edge. It's going to take time."

He continued: "My family wanted me to close the shop and give up. But it's the only life I know."

The local community rallied around Mr Ahmed in the aftermath of the incident, raising around £2,500 for new CCTV equipment in an online fundraising campaign.

Mr Ahmed - who is known to his customers as Joe - said he has been overwhelmed by their support and that the upgraded security system has made him feel safer.

"I can't thank them enough, they helped me physically, financially - they looked after me."

Police have welcomed the custodial sentences which were handed down.

Detective chief inspector Martin MacLean said: "Both of these men demonstrated their willingness to use violence during the attempted robbery of this store and their actions left the shopkeeper with some painful injuries that required medical assistance.

"However, his courage prevented the pair from stealing from his store and the subsequent assistance he provided to our inquiries proved vital in bring both McMeechan and Allan to justice.

"Tackling crimes of violence remains a priority for police in Edinburgh and these sentences are testament to the joint commitment of Police Scotland, and our colleagues at the Crown Office, in removing violent offenders from our communities."