A man on a cocktail of ecstasy and cocaine attempted to stab police officers during a drug-fuelled knife rampage in St Andrews, a court heard.
James McKinsley is facing a jail term over the incident in St Andrews, Fife, on July 7.
Several residents in the town’s Watson Avenue called 999 when they saw McKinsley shouting and brandishing two knives in the area before he made off towards Chamberlain Street.
Police quickly attended and found him in nearby Livingstone Crescent holding the blades at shoulder height.
McKinsley then stabbed the bonnet of the first police van to arrive on the scene and shouted: “Come on, come on – I’m getting you”.
Fiscal depute Eilidh Robertson told Dundee Sheriff Court that McKinsley then ran at the officers with both blades aimed at PC Nicola Purves.
She said: “She took out her baton and struck across him to keep him back. He continued to come towards her.
“It was clear to her that he intended to stab her. Sergeant Kevin Petrie then arrived in another vehicle and drove around Constable Purves to make a physical barrier.
“He continued to drive slowly towards the accused to force him back as he repeatedly stabbed the bonnet of the vehicle.
“Sgt Petrie then nudged him with the vehicle causing him to fall. The vehicle came to a stop with the accused’s legs partially underneath it.”
He then “made a stabbing motion at Constable Purves, narrowly missing her leg”.
Ms Robertson added: “He then attempted to stab another officer but only hit him with the flat side of the blade across his forearm.
“The accused then stabbed himself in the leg four times.
“The officers struck him several times with batons until he dropped the second knife.”
McKinsley, 27, a prisoner at HMP Perth, pleaded guilty on indictment to two charges of assault, one of possessing a knife and one of behaving in a threatening and abusive manner.
Sheriff Alastair Carmichael deferred sentence until next month for social work background reports and a psychiatric report.