Arran Sharp, 41, has previous convictions for violence, York magistrates heard.
He was sectioned under the Mental Health Act with a hospital order at Sheffield Crown Court six years ago and restrictions placed on when he could be released.
His solicitor Keith Whitehouse said Sharp was “released from hospital care” shortly before the incident in York on New Year’s Day.
Sharp, who gave his address as Foss Park Hospital, pleaded guilty to carrying a knife in public in Navigation Road, off Walmgate, York, and his case was adjourned while his defence team seek an “independent” psychiatric report.
Staff from Foss Park Hospital off Haxby Road, York, escorted Sharp to and from his hearing before the York court.
Martin Butterworth, prosecuting, said police were alerted on the morning of January 1 that an incident involving two people had taken place.
Armed officers sent to the scene found two men matching the description of the two involved, one of which was Sharp.
When he was searched, officers found a kitchen knife in his waistband.
He gave no comment when interviewed by police later.
Mr Butterworth said Sharp was “subject to ongoing restrictions out of hospital”.
YOU’LL FIND MORE ON THIS STORY AND OTHERS AT www.yorkpress.co.uk OR PICK UP YOUR COPY OF THE NEWSPAPER ITSELF AVAILABLE SIX DAYS A WEEK AT YOUR LOCAL NEWSAGENT

Amy Winehouse Band to Open at York Barbican for New Tour
York And Scarborough Teams Top STEM Racing Regional Finals
Seutonius Book to be Auctioned Off With Duggleby Stephenson
MP Rachael Maskell Backs Campaign for Fairer Football League
Stillingfleet Beer and Music Festival Launches Ticket Sales
Jane Tomlinson Appeal Receives £4m Applications to Giveaway
Knaresborough Native Opens Art Gallery in North Yorkshire
Two Girls On The Shore Joins Beverley Art Gallery Collection


