An armed robber fractured a shopkeeper's skull in a machete attack on a newsagent.

Liam McMeechan fled empty-handed after a struggle with Tahir Ahmed and abandoned his bloodstained blade at the premises.

Mr Ahmed realised he was bleeding heavily after the attack at A&A Newsagents on South Trinity Road and sought help from a neighbouring pharmacy.

He was taken to hospital with head wounds and a fractured skull.

McMeechan's accomplice, David Allan, was later detained by police and told them: "All I'm saying is that this is heavy and it was never the plan. It went too far."

The 23-year-old attacker had been freed three weeks from prison following his third sentence for assault and robbery.

He was originally charged with attempting to murder Mr Ahmed but the Crown accepted his plea to a reduced charge of assaulting the victim to his severe injury and permanent disfigurement at the High Court in Edinburgh on Thursday.

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

Advocate depute Mark McGuire said the 54-year-old victim was working alone at the shop when the pair came in and walked to the rear of the premises and looked at food in a fridge.

Allan then took up a position at the counter next to the door before McMeechan pulled out the machete and began shouting: "Give him the money."

Mr Ahmed pressed a panic alarm and Allan fled the shop. McMeechan hit his victim on the head with the blade and Mr Ahmed grabbed his arm and a struggle broke out.

The armed robber then delivered a second blow to the victim's head with the machete.

Mr Ahmed picked up a chair and threw it at his attacker in an effort to stop him coming behind the counter before McMeechan dropped the weapon and ran from the shop.

Mr McGuire said: "The victim took a few moments to recover and compose himself and it was only at this time that he realised he was bleeding heavily from his head."

Pharmacy staff next door to the shop gave first aid to the victim and called police.

Mr Ahmed had 14 staples put into wounds to his forehead and temple at hospital and was kept in for 48 hours for observations before being allowed home.

Mr McGuire said he was left with permanent scarring following the attack.

Police officers who arrived at the shop found items strewn across the floor along with spatters of blood.

The abandoned weapon was also recovered along with a scarf.

The scarf was found to have DNA from the mother of McMeechan, who was the former partner of Allan.

Mr McGuire said CCTV footage placed the two accused together in Edinburgh that day and analysis of McMeechan's phone showed it had been in the vicinity of the crime scene at the time of the offence.

Allan was detained later that month and gave a "no comment" interview but as he was led to cells said: "This was heavy."

Detectives found McMeechan as he returned to his home in Edinburgh before he tried to run off and was detained. He asked officers: "Have you got Davey Allan yet?"

A judge told the pair: "Clearly a sentence of imprisonment is called for in this case."

Lord Boyd of Duncansby called for background reports ahead of sentencing next month and remanded McMeechan and Allan in custody.