A prominent law firm weighed in on Maryland’s forensic mental-health crisis this week, filing a lawsuit designed to compel the transfer of mentally ill defendants from jail cells to hospital beds.

“We are seeing our clients not getting treatment, and they’re not healthy,” Mary Pizzo, an attorney and mental-health specialist at Maryland’s Office of the Public Defender, said Friday. “A jail is not the place for them to be.”

The lawsuit, filed on a pro-bono basis by the firm Venable LLP, identifies four individuals with the intent of becoming a class-action filing. The four inmates in the suit are in Baltimore and are clients of the public defender’s office there. Of the four, three are charged with attempted murder and one is charged with first-degree arson.

In all four cases, a judge determined the defendants to be mentally incompetent and a risk to themselves or others — and ordered them to be treated at Clifton T. Perkins Hospital Center, a maximum-security forensic hospital in Howard County.

But that hospital has been beyond its patient capacity for much of the past year, according to state officials, as have the four other psychiatric hospitals that are supposed to take in mentally ill patients from jails.

Throughout Maryland, according to recent counts by the state’s Department of Health and Mental Hygiene (DHMH), 84 jail inmates are waiting for court-ordered bed space. The crisis has ensnared hospitals, jails and judges — and, according to Maryland Gov. Larry Hogan (R), has become a top priority for the state health department.

“We’ll be working very closely with that department to try and find some solutions,” Hogan said Thursday.

Having clients holding in jails when they need hospital treatment is a scene defense attorneys watch play out every day.

“It’s heartbreaking,” said Rich Rydelek, who works for the public defender’s office in Prince George’s County.

Many of his clients, because of the nature of their illnesses, think the world is out to get them. Being confined in a cell affirms their fears, and, when they do mix with other inmates, Rydelek said, they are ill-equipped to deal with them.

“They are potential victims to, at a minimum, ridicule,” Rydelek said. “These people are vulnerable in the environment of a jail in a way that others are not.”

He and other defense attorneys also stressed that in many cases, while their clients are waiting for treatment and held in jails, they have not been tried in court — and could be innocent of their charges.

The crisis of the full hospitals has been developing for more than a year. More people with acute mental illness are showing up at jails, according to corrections officials, yet the number of state hospital beds has not grown.

The complaint this week named two defendants: the Maryland Department of Health and Mental Hygiene and the department’s secretary, Van T. Mitchell. A spokesman for Mitchell and the department, Chris Garrett, declined to comment Friday, citing a policy of not discussing pending litigation.

In earlier court proceedings, Mitchell and other DHMH officials have said they had limited funds to hire more hospital staffers but stressed that the crisis goes beyond funding. They said that they are having difficulty hiring new staff and are having trouble finding community treatment programs to take in patients from the state hospitals once the patients have improved.

Under Maryland law, mental illness and criminal justice intersect in two major areas.

At the time of an alleged crime, if mental illness kept the suspect from understanding they were breaking the law, they can plead not criminally responsible — commonly known as the insanity defense.

Before that happens, however, there is a stage of the criminal process known as mental competency — which covers the question of whether a person understands their surroundings well enough to participate in court proceedings. It is that part of the legal process that the legal complaint addresses.

In the case of the four Baltimore inmates, a judge had determined they were incompetent to stand trial and ordered them to Perkins for treatment — but they remained locked in jail. Attorneys involved in the litigation said they are trying to identify similar-situated inmates around the state.

According to the complaint, DHMH has not met its “clear legal obligation” to take in mentally incompetent inmates for treatment.

“Rather than complying with these court orders,” the lawsuit states. “DHMH, by its actions and inactions, requires plaintiffs and class members to languish unlawfully in jail or detention facilities.”

The complaint also states that as things now stand, similar claims have been made for individual inmates. DHMH officials, the complaint states, have addressed the one-off cases by “magically finding space in a DHMH facility, while steadfastly failing to change the practice that necessitated the initiation of the enforcement in the first place.”