A dangerous criminal could be facing a life sentence after trying to kill a former workmate in a brutal knife attack.

William Cunningham - a convicted thug and high-risk sex offender - was masked and in full biker gear when he pounced on Gordon McLeod outside his home in Catrine, Ayrshire, on February 4 this year.

The blood-soaked 29-year-old victim only managed to escape by fleeing to a nearby shop.

Cunningham was later caught and is back behind bars after he pleaded guilty to an attempted murder charge at the High Court in Glasgow.

The 57 year-old already had a raft of convictions, including for the same crime as well as child abuse.

Read More: Man denies 'dirty protest' at Ayrshire's only prison

He was hit with a Sexual Offences Prevention Order (SOPO) in 2010 due to the danger he posed to youngsters.

Cunningham made headlines a year later when he went missing after breaching the SOPO before being discovered on the Holy Isle, in the Firth of Clyde, which is owned by Tibetan Monks.

He will return to the dock for this latest crime next month.

Cunningham - latterly employed at a bed shop in Ayrshire - had worked with Mr McLeod for a spell in 2022.

Mr McLeod reported the thug had "never shown any aggression" towards him.

The victim had also been in a relationship with a young woman, who Cunningham had described as his 'goddaughter'.

The court heard claims there were later issues between the couple. She had also spoke about seeing another man.

The woman later arranged to collect belongings and Cunningham joined her on the trip to Mr McLeod's flat.

They were in a taxi with one of her friends. The atmosphere was described as "weird".

The woman was then heard whispering to Cunningham: "This better not come back to us."

Cunningham rummaged through his bag bringing out leather gloves and a black Covid mask.

A knife was then spotted hanging out his pocket - but claimed it was "nothing".

Cunningham - wearing a black bandana and leather jacket with biker pictures - got out the car.

The woman told her friend: "I think Billy is going to do something to do something to Gordon. This will be better for all of us if he is gone."

Mr McLeod later left his flat when he suddenly felt a "sharp blow" to the back.

Prosecutor Lindsey Dalziel said: "Gordon McLeod turned around and saw a male dressed in black trying to cover his face with his arm.

"He saw a glint of a blade - Cunningham stabbed him in the stomach.

"Gordon McLeod kicked out, there was a struggle and Cunningham slashed him on the right side of the face."

The victim escaped to the shop and first aid was initially given by shocked witnesses.

As sirens were heard in the street, the face of Cunningham's 'goddaughter' was said to have 'dropped'.

She stated: "I think Billy has attacked Gordon."

The court heard the victim needed hospital treatment for wounds to his stomach and underarm as well as injuries to his face, wrist and fingers.

Miss Dalziel said he may have died, but for immediate medical help.

Read More: Offensive Hallowe'en costumes that could upset people and get you in trouble

Lord Scott told Cunningham's lawyer Euan Dow: "So, it appears almost exactly 26 years after he was sentenced for attempted murder, here we are again."

The judge initially adjourned the case until next month in Edinburgh for a social work report to be completed. Cunningham was remanded.

Lord Scott told the thug: "I should make clear I am calling for this report is because I am considering an extended sentence.

"I have not ruled out the possibility of making a risk assessment which may take us down a path of a further report that could end in a life sentence.

"But, we will see, we will take it one step at a time."