The court unanimously upheld a ruling by a Pierce County judge.
The state's involuntary treatment act allows counties to briefly detain people suspected of having mental problems who present an imminent risk of harm to themselves or others, or are gravely disabled. The detention is for the purpose of evaluating, stabilizing and treating the disorder.
However, Pierce County frequently lacked enough space in certified evaluation and treatment facilities, and regularly resorted to temporarily placing those it detained in emergency rooms and hospitals, where they received little or no treatment.
That is a practice known as "psychiatric boarding."
Ten people who were involuntarily detained challenged the practice, and the trial judge found psychiatric boarding was unlawful. Upon appeal, the Supreme Court agreed.
"Patients may not be warehoused without treatment," the high court ruled.
Rather, patients have a right to adequate care and individualized treatment, the court said. And state law required they be detained in certified evaluation and treatment facilities.
"This definition does not include hospital emergency rooms or acute care centers unless they are specifically certified," the Supreme Court said.
The state Department of Social and Health Services said the decision means people with mental illness could end up on the streets instead of in hospitals.
"DSHS, as always, respects the authority of the courts, but we are very concerned for the people in need and for the community," said Victoria Roberts, the agency's deputy director.
The department has proposing allowing local governments to increase local option taxes to support community mental health funding. It also wants to add capacity at the state mental hospitals to meet the demands for court-ordered competency evaluations, according to Roberts.
But Scott Bond, president of the Washington State Hospital Association, said the ruling was a good one for hospitals and patients.
"Patients who are in psychiatric crisis need to be seen in safe and comfortable environments, and should not have to wait indefinitely," Bond said. "We are looking forward to working with the state and others to reform the system and secure the funding that will help ensure that patients get the care they need."
The state's involuntary treatment act was enacted in 1979, and the state's mental health system was almost immediately overwhelmed by patients.
In early 2013, 10 people were involuntarily detained in Pierce County, mostly in emergency rooms and hospitals. In all 10 cases, the county sought to hold the people for up to 14 days.
Several of the patients moved to dismiss the 14-day petitions on the grounds they were not in certified evaluation and treatment facilities.
During a February 2013 hearing before a mental health commissioner, witnesses testified that patients held in hospitals generally received little or no mental health care. A witness also said the use of hospitals to house the mentally ill had exploded in recent years and was continuing to increase.
The commissioner found that the psychiatric boarding was unlawful.
Pierce County and the state health services agency challenged that finding, saying psychiatric boarding was allowed to avoid overcrowding certified facilities. But a Pierce County judge ruled that such boarding in hospitals was illegal.