If you are accused of a crime and arrested in Galveston County, Texas, you better hope you can afford to pay the preset bail amount to get out of jail. If not, then you will join hundreds of other people who are incarcerated simply because they cannot afford to buy their freedom. In Galveston and communities across the country, there is one pretrial detention system for the poor and an entirely different one for everyone else.

Thirty-six-year-old Aaron Booth found this out the hard way last April after being arrested for felony drug possession. Booth’s arresting officer consulted with a prosecutor who set his bail at $20,000, the minimum amount permitted under Galveston County’s felony bail schedule, even though Booth lives near the poverty line. Booth then saw a magistrate judge who automatically adopted his bail amount without asking him about his ability to make bail or determining whether he was a flight risk or a danger to the community. Booth asked the magistrate for a court-appointed attorney, but at the time of his hearing and at the time his bond was set, the county had failed to provide an attorney to represent him.

On April 8, 2018, the American Civil Liberties Union, the ACLU of Texas, and Arnold & Porter filed a class action lawsuit in U.S. district court on behalf of Booth and other similarly situated people who remained in jail solely because they were too poor to pay their bail. We sued Galveston County, the magistrate judges, district court judges, and the district attorney for violating the substantive and procedural due process rights of Galveston County residents as well as their rights to equal protection and counsel guaranteed by the Constitution. Booth argued that everyone with a hand in Galveston’s system was legally responsible, including the district attorney who sets bail amounts, the magistrates who sign off on them without a hearing, and the trial judges who refuse to pass rules to fix this system.

Last week, the case cleared a major hurdle when a federal magistrate judge rejected the defendants’ motions to dismiss the case. Their argument was twofold: They maintained that they did not violate anyone’s rights, and even if they did, they were not liable. The favorable ruling means the case is still alive and moves forward towards class certification and injunctive relief, a legal remedy that orders the defendants to immediately stop its practices.

Without injunctive relief, Galveston County will continue locking up hundreds of people because they cannot pay for their liberty. But this situation isn’t confined to Galveston. Pretrial detention systems predicated on wealth are widespread across the country, which is why the ACLU has filed similar lawsuits in other municipalities nationwide. Last week’s ruling in Galveston, however, included two provisions that could be groundbreaking for bail reform litigation nationally.

In their ruling, the district court recognized that the prosecutor is accountable for perpetuating wealth-based detention, which is virtually unheard of since prosecutors are usually immune from liability in civil rights cases. The court also held the prosecutor accountable for perpetuating wealth-based detention because he knew his staff was setting bail amounts that were rubber-stamped without a hearing — something that no court has held before.

The district court also found that a bail hearing is a critical stage of a criminal proceeding at which the arrestee must have counsel appointed if she cannot afford it. The Constitution gives people the right to a lawyer whenever a judge is deciding whether to jail them before trial. The consequences that result from being in jail for only a few days can be devastating. In addition to losing their freedom, people locked up pretrial risk losing their job, housing, educational opportunities, or custody of their children. This is the type of harm that lawyers call “irreparable,” and it requires a court order to fix it.

No one should ever be jailed simply because they don’t have the resources to make bail. There is still a long way to go to get equal justice in criminal cases in Galveston County, but this ruling is a good step in the right direction. If we ultimately prevail in this case, then the bail practice in Galveston County will finally change and people will not remain in jail simply because they are poor. It may also set a precedent of prosecutorial accountability and right to counsel at bail hearings that we hope will apply nationally.