A thief was caught rifling through a north-east home when the owner came home – so he jumped from an upstairs window to escape.
The 17-year-old, who cannot be named for legal reasons, broke into the house on Straik Place, Skene, on August 2 this year and fled with 125 euros.
But that was not the end of his offending, Aberdeen Sheriff Court heard.
The teenager then went to a property on Eastside Drive, Westhill, broke into a shed and removed a knife and hammer.
The court heard the residents returned and found him in the garden trying to break into the house.
Depute fiscal Lucy Simpson said: “He told them he was there to repair something on the house.”
They called police, who arrested the teenager near the Holiday Inn, Westhill, seconds before he intended to flee in a taxi.
He then racially abused a Polish police officer at Kittybrewster Police Station and headbutted him.
Keep up to date with the latest news with The Evening Express newsletter
The youth, whose address was given as HMYOI Polmont, admitted two counts of housebreaking, one count of attempted housebreaking, racial abuse and assaulting a police officer.
Defence agent Liam Mcallister said: “This was an amateurish, opportunistic but nonetheless serious series of offences. He understands it is appalling conduct.”
Sheriff Andrew Miller deferred sentencing for reports until December 19.