An NHS assessment and treatment unit in Oxford requires "urgent" action to make it safer, an inspection carried out by a health watchdog has found.
The Care Quality Commission (CQC) found dirty toilets, outdated equipment, and broken fittings, during unannounced visits to Slade House in Headington.
Patients were not "cared for in a clean, hygienic environment," it said.
Southern Health NHS Foundation Trust said it was closing the site to new admissions while it made changes.
Slade House provides health care across two sites for people with mental health needs, learning disabilities, and problems with substance misuse.
The CQC inspected the facilities on 16, 17, and 23 September.
Its report outlined how one person told officers they felt unsafe and uncared for, and another said they "hated it" there.
A relative told officers their son, a voluntary patient, had frequently asked to leave but was told he could not do so unless he attended specific workshops.
"This meant that he was illegally deprived of his liberty," the report said.
It describes an "impoverished environment" with "little therapeutic intervention or meaningful activities to do" and where cleaning was "wholly inadequate".
The cleaner had left three weeks previously and had not been replaced, the CQC was told.
Other issues included a defibrillator being left with no batteries and an oxygen cylinder that had expired, so neither could be used in emergencies.
In response to the report, Katrina Percy, chief executive of the trust, said: "We were most concerned to learn of the issues brought to light by the CQC in a recent visit.
"We are concerned the points raised in the report did not come to light sooner and have launched our own internal investigation.
"We have taken the findings extremely seriously. The units are both closed to new admissions and will remain so until we can provide assurance that we are able to deliver the best possible care to our patients.