A man suffering from poor mental health was found at Huddersfield Railway Station with a knife after leaving hospital for the day.
Umar Shezad was receiving treatment at Calderdale Royal Hospital when he disappeared on September 25 last year.
Police found the knife in the 24-year-old’s sock and he claimed that he kept it for his own protection.
Shezad pleaded guilty to possession of a bladed article in public when he appeared at Kirklees Magistrates’ Court.
Bill Astin, prosecuting, said that Shezad called police himself from St George’s Square to report that he had gone missing from the Ashdale Ward.
He had been staying at the Halifax hospital after being sectioned under the Mental Health Act.
Mr Astin explained: “He said he didn’t like crowds and this was making him uneasy.
“Police detained and searched him and he was found to be in possession of a six inch black handled kitchen knife tucked into his sock.”
Magistrates that Shezad suffered from paranoid schizophrenia with delusions and on the day of the offence thought that he had travelled to Dewsbury to visit his aunt.
There was no suggestion that Shezad, of Ouzlewell Road in Thornhill, brandished the knife at any point.
Magistrates sentenced him to a community order as a direct alternative to custody, including non-residential mental health treatment.
He must pay £85 costs and the knife will be forfeited and destroyed.