A man repeatedly battered a shop worker with a hammer in an attempted murder.

James McMurdy hit Senga Houston with a hammer, even as she lay prone on the ground at the store in Catrine, East Ayrshire.

The 40-year-old had raided the store in desperation for money because he faced eviction from his flat.

At the High Court in Glasgow, a judge watched footage of the November 2017 attack which left the 63-year-old victim with "life changing" injuries.

Ms Houston spent two months in hospital, and may need medical care for the rest of her life.

Details emerged as McMurdy pleaded guilty on Tuesday to robbery and attempted murder.

The court heard that Ms Houston had worked at the Premier Convenience store for around eight years, and was there alone around 2.40pm on November 5, 2017, when McMurdy came in through the back of the shop.

He was clutching a hammer and a knife with his face covered with a piece of bed sheet.

McMurdy moved Ms Houston towards the counter and demanded she open the till, and eventually stuffed around £500 into his pocket.

The court was then shown CCTV footage of what unfolded next, described by Lord Mulholland as "graphic".

Prosecutor Liam Ewing told the court: "He placed both hands around the hammer, drawing it above his head before striking her causing her to fall to the ground.

"She attempted to cover her head with her hands, but McMurdy moved them away and struck her a further nine times with the hammer."

He then fled, but a shopper soon came in and heard Ms Houston's groans.

The emergency services were called, and she was rushed to intensive care in Glasgow suffering from "life threatening" injuries.

A large scale hunt was launched to catch McMurdy, and a CCTV check spotted him leaving his nearby home shortly before the raid and going into the shop.

Police later attended at his flat and a crazed McMurdy holding a knife yelled: "Anyone comes in here, they are getting murdered."

Mr Ewing said: "He stated that after he had the money out of the till, Senga Houston said his name which caused him to strike her with the hammer.

"He said he did not mean it and that he just wanted to knock her out to shut her up."

McMurdy claimed added he had not been taking "medication for a while".

Mr Ewing added: "He also indicated he had been threatened with eviction, needed money, so he decided to rob the shop."

Officers went on to find a knife, £485 and a blood stained hammer at his home.

The court heard Ms Houston was treated at hospital for a number of serious conditions including "multiple" skull fractures and a "complex brain injury".

Her sight has been permanently affected and she is no longer able to drive or work.

McMurdy was told he could face an Order of Lifelong Restriction when he returns to court in June.

The judge said: "This has been horrific and life changing for the victim, who was doing no more than serve the public. What you did was brutal and barbaric."

McMurdy was remanded in custody.