A former soldier faces a four-month curfew after a run-in with police officers at his Hamilton home.
Daryl Campbell, who spat on one officer, apologised this week for his "disgusting and unacceptable" behaviour.
Campbell, 26, admitted assault and threatening or abusive behaviour in Alness Street on April 12, 2020.
His lawyer told the court that he became "confused and upset" when four officers turned up in his living room.
She said: "He had drunk a copious amount of alcohol and didn't hear the police arrive, so he didn't answer the door and they let themselves in.
"This happened during the first Covid lockdown when he had been suffering mental health difficulties.
"He recognises the police were only performing their duties and the way he reacted was completely wrong.
"It was disgusting and unacceptable, and he tenders his apologies."
The court heard Campbell served with the army in Northern Ireland for three years. He now works as a charity fundraiser.
Sheriff Martin Jones said he was persuaded, given Campbell's "good work record" and lack of previous convictions, to impose an alternative to prison.
Campbell was put under supervision for 12 months and ordered to do 140 hours of unpaid community work.
He will also be electronically tagged for four months, meaning he's confined to his home between 7pm and 7am each day.
The sheriff warned him: "Breaching either of these orders will likely result in a custodial sentence."
Don't miss the latest headlines from around Lanarkshire. Sign up to our newsletters here.
And did you know Lanarkshire Live is on Facebook? Head on over and give us a like and share!