The authorities were left with no choice after a High Court judge ruled that Alan Williamson, jailed for six years in 1988 for attempted rape, cannot be detained against his will without a special court order, which could take weeks to obtain.
Mr Justice Tucker said the problem arose after the patient's nearest relative, his father, George, from Stockton-on-Tees, Cleveland, refused to co-operate with doctors over his son's continued detention in a secure unit at Winterton hospital, Sedgefield, near Stockton.
Cleveland County Council's social services department failed last year to start in time special county court procedures that would have enabled the authority to take over the role of "nearest relative" and keep the 36-year-old patient in hospital.
Mr Williamson's social worker, Megan Wilson, obtained a 28-day detention order as a "stop-gap" until the county court application went through. But it was the second "assessment" order of its kind, and such "back-to- back" orders were not legally valid, the judge ruled.
He said: "I wish to make it plain that I do not impute any improper motives either to Miss Wilson or to the managers. They found themselves in a difficult situation where they were not receiving co-operation from the nearest relative, and while they were anxious not to release into the community a patient who might be a danger to himself and to others." The judge said he hoped the application to get a "nearest relative" order "will be speedily resolved".
Len Wilson, chief executive of South-west Durham Mental Health Trust, said Mr Williamson had been told he was free to go. "As a consequence he decided he wished to go home."
Asked about the risk the patient might pose to others, Mr Wilson said: "I cannot comment on his clinical condition."
David Behan, Cleveland's director of social services, said: "Obviously we are deeply concerned . . . We hope that it will be possible to complete the [nearest relative] application under Section 29 of the Mental Health Act as quickly as possible. In the meantime, we hope to maintain contact and support to the individual and his family and still hope that they will consider the wisdom of his remaining in hospital as a voluntary patient at this stage."
Mr Justice Tucker allowed Mr Williamson's application for judicial review against social service moves to continue detaining him.
The judge described how, after he was jailed for attempted rape, Mr Williamson was discharged in 1992, but re-admitted to hospital as an informal patient in February 1994.
When he again tried to leave last October, doctors considered the move "inappropriate" and detained him under section 5 of the Mental Health Act. His father did not consider that he required compulsory admission.
A consultant forensic psychiatrist recommended that Mr Williamson stay in hospital "for treatment" as an informal patient, but that could only happen with his consent, the judge said.
The consultant suggested that, if he would not agree, Mr Williamson should be compulsorily detained "as a last resort" under section 3 of the Act. The problem was that Mr Williamson's father objected and was able to block the move.