A man bailed after threatening to "plug" a police officer was later found carrying a machete in a Hamilton street during his curfew hours.
Robert Mitchell was jailed for two years at Hamilton Sheriff Court this week.
The 33-year-old admitted possessing a bladed item in Bothwell Street on April 6, breaching a bail curfew and giving police a false name.
Mitchell also admitted threatening or abusive behaviour and resisting arrest in Marswood Green, Hamilton, on January 13.
Chloe O'Hara, prosecuting, said police officers on patrol in Burnbank were approached by a member of the public who told them Mitchell was in possession of a machete.
Hamilton Sheriff Court heard: "Officers went to the accused's home.
"He was under a curfew and it was just before 8pm, but there was no reply at the door.
"Police officers then attended at Bothwell Street where the accused had been seen to discard a carrier bag.
"They found a machete measuring approximately 30cm inside the bag."
Referring to the incident in January, Ms O'Hara said police were called to Marswood Green where the landlord of a property was asking Mitchell and a woman to leave.
Mitchell became abusive, saying police were arresting the woman for nothing, then yelled 'if I see you in the street I'll plug you, you horrible-looking wee pr**k'.
Defence agent Stephen McQuillan acknowledged his client has a "lengthy" record that includes a High Court conviction.
He said Mitchell was "pragmatic" about the outcome of the case, but would appreciate a chance to "rebuild his life".
Sheriff Liam Murphy said prison was inevitable given the accused's record and the nature of the charges.
The two-year stretch was backdated to April 7 as he has been in custody since then.
*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!