Ryan Yates admitted carrying out the attack in Aberdeen
A man has admitted trying to murder a 60-year-old woman in an Aberdeen park amid a plan to abduct and rape her two granddaughters, aged eight and two.
Ryan Yates, 29, stabbed the woman while the children escaped in the Bridge of Don area of the city last October.
Two days before the incident he was put under a court order banning him from accosting females after a sex attack, the High Court in Edinburgh heard.
Sentence was deferred for a full risk assessment order.
Yates carried out the attack five days after he was released from prison for an assault which contained a sexual element.
He was caught by police shortly after the attack and said he had gone out that day "looking to find some children to have sex with".
He said he intended to kill the woman he attacked "so that I can get to the kids".
Advocate depute Alan Mackay said: "While walking in the park the younger child asked to come out of her buggy. The grandmother bent down to unbuckle the child from the buggy and noticed a pair of legs standing very close to her.
"She stood up and saw the accused close by, less than an arm's length away. He was holding a sharp pointed kitchen knife with a serrated edge in his right hand."
He said that, without warning, Yates then thrust the knife towards the woman's chest and during the ensuing struggle the victim found herself on the ground.
She grabbed the bottom of the blade and top of the knife handle and kicked out at her attacker while the elder of the children fled with her younger sister.
Mr Mackay said: "The struggle for the knife continued and Yates told her he'd let her go if she let go of the knife. She refused and the accused spat in her face as she continued to struggle and scream."
A woman intervened and Yates walked away "quite calmly".
Police soon tracked him down. During an interview he maintained that he would have had sex with the children despite their ages but would have let them go afterwards.
Mr Mackay said the grandmother was left with a scar on her left hand which served as a constant reminder of the incident.
The incident happened in a park in Aberdeen last year
He said: "When she is out walking now she feels that she is constantly looking over her shoulder.
"She also indicates that she is concerned for her grandchildren's safety."
Unemployed Yates admitted attempting to murder the grandmother with the intention of abducting and raping the young children in Westfield Park on 14 October last year.
He also admitted breaching the terms of an interim sexual offences prevention order made against him at Aberdeen Sheriff Court two days earlier.
The court heard that Yates was sentenced to four years detention in 1994 after being convicted of three charges of indecent assault and two of assault.
He was given a further two-year term of detention in 1999 for an attack on a woman and was given another seven-year extended sentence in 2003 following a High Court conviction for assault containing a sexual element.
Lord Pentland placed Yates, who is in custody, on the sex offenders' register pending the risk assessment report, due in April.
Det Supt Brian Yule, of Grampian Police, said: "This was a horrific crime targeting an innocent woman out for a walk in the park with two young children."
He added: "Grampian Police and its partners are thorough in its application of nationally-set regulations for dealing with registered sex offenders.
"At the time of his arrest, Yates had fully complied with all the conditions relating to his registration and our officers had visited him regularly in the days after his release.
"We and the other partners involved in the supervision of offenders devote considerable resources to this area and we will continue to do so in order to provide the best possible levels of protection to the public we serve."
Yates told police after the attack that he had wanted to be sent back to prison. Officers believe he may have become "institutionalised" after so much time in jail.
Det Supt Yule suggested that politicians could consider the case for new powers, allowing police to seek extensions to prison sentences if offenders fail to comply fully with rehabilitation programmes.