Patients said they were denied care as soon as they appeared stable. One of the plaintiffs in the case said in a filing her son, who struggled with substance abuse, died after he was forced to leave a residential treatment facility when the insurer denied coverage.

“In our view, it’s a monumental win for mental health and substance abuse patients,” said D. Brian Hufford, an attorney with Zuckerman Spaeder, who, along with Psych-Appeal, a private law firm specializing in insurance coverage for mental health issues, is representing the plaintiffs. The plaintiffs are part of a class-action lawsuit against United Behavioral Health, and say they were covered under the United plans from 2011 to 2017 and denied care.

In the aftermath of the ruling, the company maintained that it had not failed to provide the proper care.

“We look forward to demonstrating in the next phase of this case how our members received appropriate care,” said UnitedHealth in an emailed statement. “We remain committed to providing our members with access to the right care for the treatment of mental health conditions and substance use disorders.”

Judge Spero is expected to reach a final judgment in the next few months.

The case represents the latest development in the contentious debate over how health insurance companies cover mental health and substance abuse disorders, as compared to medical conditions like diabetes, multiple sclerosis and asthma. In spite of the passage of a federal law, the Mental Health Parity and Addiction Equity Act of 2008, patients have long complained about the difficulty of getting care covered, especially when they are in no immediate danger.