Criminal defendants are languishing in Philadelphia jails as court officials fail to abide by rules and state constitutional mandates that should guide the use of cash bail, the American Civil Liberties Union alleges in a lawsuit filed Tuesday in Pennsylvania state Supreme Court.

The ACLU of Pennsylvania observed more than 2,000 bail hearings in recent months and says court officials were regularly flouting rules meant to keep people charged with—but not convicted of—crimes from remaining locked up before trial because they cannot afford bail.

“These rules were created to encourage pretrial release on non-money conditions and limit the use of pretrial detention,” Reggie Shuford, executive director of the ACLU of Pennsylvania said in a statement. “In Philadelphia bail hearings, it is usually money bail or nothing.”

It’s not the first time in recent years bail practices in Philadelphia have drawn scrutiny.

The City Council last year approved a non-binding resolution calling for less reliance on cash bail in the city and urging state officials to move toward allowing for its elimination. District Attorney Larry Krasner, a former defense attorney elected in 2017, a few weeks later said that prosecutors would stop seeking cash bail for people accused of certain low-level misdemeanors and nonviolent felonies.

The new lawsuit was filed on behalf of 10 people in custody who said they cannot afford bail, along with two community organizations. It was lodged against a half dozen magistrates who oversee arraignment hearings where bail is assigned.

A spokesman for Pennsylvania’s First Judicial District, which includes Philadelphia’s municipal court, declined to comment on the lawsuit, saying the court can’t discuss cases or filings.

Challenges to judges’ bail setting practices—and more broadly seeking to end cash bail entirely—have gained traction in recent years. In January, legal advocates filed a lawsuit against St. Louis, Missouri, arguing the cash bail system is unconstitutional.

States have also taken on the issue.

Pennsylvania’s neighbor, New Jersey, in 2017 implemented policies to largely shift courts in the state away from cash bail, and adopted a multi-step framework for them to follow when considering whether to release someone or keep them in jail while they’re awaiting trial.

Representatives for the companies have defended cash bail as an important part of the system that allows for people to be released before trial and continue participating in their communities.

Lawmakers in New York, meanwhile, have been at work this year on an effort to revamp and possibly end the state’s cash bail system.

The Philadelphia lawsuit argues that under the state’s constitution there’s a presumption defendants should be entitled to pretrial release except under limited circumstances—like if a person is facing charges that could lead to the death penalty or life in prison, or if detaining the person is the only option to reasonably ensure public safety.

It also points to state criminal procedure rules governing bail that emphasize that Pennsylvania law favors the release, rather than detention, of people with charges pending against them.

The rules lay out certain guidelines for courts to follow when considering pretrial release and bail.

For example, before cash bail is imposed the court “shall consider” the defendant’s financial situation. And bail “shall not be greater than is necessary to reasonably ensure the defendant’s appearance and compliance with conditions of the bail bond.”

Another rule stipulates that no condition of release should be imposed against someone for the sole purpose of keeping them jailed until trial.

Magistrates are failing to adhere to the criminal procedure rules, the lawsuit claims.

“Every day, Respondents impose monetary bails that defendants are unable to pay,” the legal complaint says. Often, it adds, magistrates appoint a public defender based on the finding a defendant is poor, “and then immediately proceed to impose cash bail.”

The 55-page complaint describes how preliminary arraignments for people arrested in Philadelphia are held about every four hours, seven days a week, every day of the year. It notes that in 2017 alone there were 38,480 new criminal cases filed in municipal court there.

During preliminary arraignments, a magistrate on duty, a representative from the Defender Association of Philadelphia and a representative from the district attorney’s office are in the courtroom, and in some cases defendants retain a private lawyer.

The person who is being arraigned doesn’t go to the courtroom. They remain at a booking facility and participate in the hearing via a video conference.

Defendants commonly have difficulties hearing what’s going on in the courtroom over the video feed, and hearings last only a few minutes, the lawsuit alleges.

It says bail was assigned in at least 599 hearings that were timed by observers and that the median length of these hearings was three minutes and 72 of them lasted one minute or less.

The lawsuit says that in 163 hearings the magistrates imposed bail of $100,000 or more without explaining the reasons why it was set so high, considering alternative conditions for release, or acknowledging evidence that the defendant was unable to pay.

A research paper released last month by professors at the University of Pennsylvania and George Mason University on the bail roll back Krasner adopted found it led to a 12 percentage point uptick in eligible defendants released without cash bail or other conditions. They also found no change in failure-to-appear in court or recidivism rates.

Bill Lucia is a Senior Reporter for Route Fifty and is based in Olympia, Washington.