A man who killed a prostitute and was freed early from jail produced a knife during an appointment with a psychiatrist.
Joseph Harrison claimed he heard voices telling him he was being targeted by a “death squad”.
And a sheriff has now imposed a compulsion order detaining him in hospital without limit of time.
Harrison was jailed for six years for killing prostitute Susan Third.
The 21-year-old approached him as he sat crying in his car at Aberdeen harbour in February 2005.
He later strangled her before driving to a field near Catterline in Aberdeenshire, where he sexually assaulted the mum-of-one and dumped her body.
He was convicted of culpable homicide on the grounds of diminished responsibility and jailed for six years. He was released after serving four years.
Perth Sheriff Court heard yesterday that Harrison, 38, had been moved from the State Hospital at Carstairs and into prison before being released in February 2009. His licence period ran out in February last year.
Fiscal depute Carol Whyte said that three months later he was at a meeting with a consultant psychiatrist when he produced a knife with a four-inch blade from his pocket and was subsequently arrested.
Former farm worker Harrison, who is originally from Brechin in Angus, admitted having the knife at the Murray Royal Hospital in Perth on May 20 last year.
After hearing about the post-release incident with the knife, Sheriff Fiona Tait made Harrison the subject of a compulsion order.
He will be detained at Murray Royal psychiatric hospital without limit of time.