A man found with a knife warned police officers he would have them and their families shot.
John Nicol, 43, also hurled racial, sexual and sectarian insults after his arrest.
Nicol, a prisoner, appeared at Hamilton Sheriff Court this week and admitted unlawful possession of a kitchen knife in Vennacher Street, Shotts, on July 31.
He also admitted threatening or abusive behaviour.
Abby Seal, prosecuting, said police found Nicol in the street after responding to a call from his father.
They decided to search him and asked if he was carrying anything sharp.
The fiscal said: “He replied ‘I’ve got a knife for my own protection’.
“The officers found a kitchen knife concealed in the waistband of his trousers.
“He then became hostile and kicked the door of the police van.
“He made comments including ‘This is your last run. I’m getting you and your families shot’. At Motherwell police station he made a shooting gesture and said ‘Say bye-bye to your families’.”
Defence agent Matthew McGovern said Nicol, who has previous convictions, is on medication for mental health issues.
The solicitor told Sheriff Liam Murphy: “He lost his mother shortly before these offences and struggled to cope with her death. There was a deterioration in his mental health.
“His record is serious but I would ask the court to consider a non-custodial sentence.”
Sheriff Murphy adjourned the case until next month for background reports.
Nicol, who has been in prison since his arrest, was again remanded in custody.
*Don't miss the latest headlines from around Lanarkshire. Sign up to our newsletters here.
And did yo u know Lanarkshire Live is on Facebook? Head over to our page to give us a like and share.