A man suspected of drug offences ran off after being stopped by police on an Aberdeen street.
But officers ran after Andrew Wills, 25, and he was charged with obstructing them in their duty.
Wills appeared at Aberdeen Sheriff Court and admitted obstructing the two officers as they investigated possible drug offences.
Keep up to date with the latest news with The Evening Express newsletter
The court heard that the officers had been out on patrol on George Street, Aberdeen, at 2.20am on July 3 last year when they spotted Wills.
They had reason to believe he could be committing a drug offence and were about to search him when he fled, before being caught and arrested, the court heard.
Sheriff Ian Wallace told Wills, whose address was given in court as Old Church Road, Aberdeen: “It was a stupid thing for you to do.”
He ordered Wills to carry out 35 hours of unpaid work within three months.