A hospital had to go into lockdown after a man terrorised nursing staff and patients, Jedburgh Sheriff Court heard.
Carl Kirsopp burst into Kelso Hospital on the evening of May 3 and said: “I need help, man” before shouting at staff: “Stop staring at me, man.”
The 32-year-old, of Kelso, was highly agitated and appeared to be under the influence of drink or drugs, according to alarmed staff.
They then dialled 999 and locked the hospital building to stop him getting back in.
When the police arrived, Kirsopp was banging on the door of the Inch Road community hospital and trying to get back inside.
Procurator fiscal Graham Fraser said the five female members of staff and 23 patients there had been “greatly alarmed” by Kirsopp’s behaviour.
Three days later, Kirsopp was involved in another incident, in Rosewood Gardens in Kelso.
He brandished a knife, damaged a car tyre with it and behaved in a threatening or abusive manner as he tried to locate his partner after she had gone to visit a friend, the court heard.
Kirsopp pleaded guilty to a total of seven offences.
Defence lawyer Mat Patrick said his client told him he had suffered a “psychiatric blow-out” at the time of those offences.
Kirsopp was jailed for over 18 months, with his 580-day sentence being backdated to May 7, that being when he was first taken into custody.