A Moray man attacked a friend after being repaid money from an ATM outside an Elgin supermarket.
Kieran Shand from Burghead then ran off while police were dispatched to trace him, having been informed he was carrying a knife.
Kieran Shand was sentenced at Inverness Sheriff Court.
Shand was chased down a lane by the officers, with one shouting out a warning he’d deployed his taser.
The 29-year-old then ran towards the police but, on being warned a second time, dropped to the ground and complied with his arrest.
Speaking at Inverness Sheriff Court, prosecutor Naomi Duffy-Welsh said: “A search was carried out of the area for the knife but it was not found. However it was later recovered in a nearby back garden.”
She added: “It was a large multi-coloured Rambo-style knife.”
Defence solicitor Mike Chapman told the court his client had not been carrying the knife to cause harm to the victim or to anyone else.
Shand admitted carrying out the assault on December 8, 2023, near the Scotmid store in Glassgreen.
He also pleaded guilty to possessing a knife or having resisted arrest by running away.
Mr Chapman added: “At the time he was suffering from an alcohol and drug addiction. He lost his grandmother to whom he was close. The trigger point was the ending of his relationship.
“He is now in a new one and has taken significant steps to turn his life around. There has been no further offending as he is benefiting from supervision imposed as part of a current community payback order.”
Sheriff Ian Cruickshank ordered Shand, of Fraser Road, Burghead, to carry out 180 hours of unpaid work for the community.
The defendant was also placed under the supervision of social workers for the next 18 months.