A shoplifter expecting to be jailed had a blade in a holdall he took with him to a police station.
His lawyer claimed Michael Griffin forgot to remove the item before packing the bag.
Griffin, of Donald Terrace, Hamilton, was jailed for 18 months at the town's sheriff court on Friday.
The 33-year-old admitted illegal possession of a Stanley blade on March 23.
Griffin also admitted stealing confectionery worth £56 from Scotmid in Neilsland Road, Hamilton, the previous month.
Chloe O'Hara, prosecuting, said police officers went to the accused's home to arrest him in relation to the shoplifting.
She stated: "He had a holdall that he said he was taking with him to prison.
"This was searched and officers recovered a Stanley blade."
Defence agent Jackson Bateman said Griffin had packed the bag knowing it was likely he would be kept in custody after being interviewed at Motherwell police station.
Mr Bateman told the court: "The blade was in the side compartment.
"Previously he had the bag with him when working. This was a spare blade for a knife and he forgot to remove it.
"He is long enough in the tooth and has enough experience of police procedure to know that everyone and everything that goes into a police station will be searched."
Sheriff Andrew McIntyre noted that Griffin has a "very long record" that includes convictions for knife offences.
The sheriff added: "Your record for theft is unbelievable."
The 18-month sentence was backdated as Griffin has been in custody since his arrest in March.
*Don't miss the latest headlines from around Lanarkshire. Sign up to our newsletters here .
And did you know Lanarkshire Live is on Facebook? Why not head to our page and give us a like and share.