A man barricaded himself inside his Aberdeenshire home and threatened to “beat” police officers if they came in.
Logan Wilson reacted angrily when police responded to a 999 call and arrived at his flat.
The 22-year-old met officers with a volley of verbal abuse before threatening them with violence if they entered.
But Wilson, who now acknowledges he was “stupid”, has now been fined for his actions.
Fiscal depute Georgia Laird told Aberdeen Sheriff Court the incident happened around 9pm on May 8 this year at Wilson’s address at Michael Fair Court, Aboyne.
She said police attended at the property due to an unrelated 999 call, but were met with Wilson shouting and swearing at them.
‘He feels very stupid about acting that way’
She said: “The accused began to barricade the door to the flat, preventing entry to it.
“The accused continued to be abusive by shouting, swearing and making threats, stating ‘If you come in I will be the one who beats you’.”
This caused the officers “concern” and Wilson was eventually arrested.
Wilson, of Michael Fair Court, Aboyne, pled guilty to a charge of behaving in a threatening or abusive manner.
Defence agent Leonard Burkinshaw told the court Wilson’s partner had phoned the police but he had not realised and so took issue when they arrived.
He added: “He feels very stupid about acting that way.
“He spent the night in the cells for his troubles.”
Sheriff Shirley McKenna fined Wilson £220.
For all the latest court cases in Aberdeen as well as crime and breaking incidents, join our Facebook group.