Police officers had to use CS spray to subdue a 45-year-old man involved in a violent disturbance at his remote Peeblesshire home.
Brian Thomson’s wife called the Scottish Ambulance Service at 1.30am due to her concerns about his behaviour.
The police accompanied them and when they arrived at the house in Kilbucho, near Broughton, they heard shouting and swearing.
Selkirk Sheriff Court was told the officers tried to engage with the self-employed fence constructor as they entered a bedroom strewn with broken items, but he continued shouting and swearing agitatedly and challenged them to fight.
Thomson grappled with the police and eventually the four officers trying to restrain him sprayed CS gas in his eyes.
Thomson was arrested at 2.40am and taken to the Borders General Hospital at Melrose to be checked over.
He pleaded guilty to two charges of behaving in a threatening or abusive manner and also struggling violently with police.
Defence lawyer Mary Harrower explained that his client suffered a shoulder injury two years ago and became addicted to painkillers.
He had admitted taking some cocaine on June 1, resulting in him having a psychotic episode.
Sheriff Mark Thorley said the incident involving the police was significant but deferred sentence for six months for good behaviour.
The case will recall at Selkirk Sheriff Court on December 17.