ST. LOUIS — A federal judge has ordered changes to the bail system in St. Louis and granted class-action status to a lawsuit filed on the issue.

United States District Judge Audrey G. Fleissig ordered the jail commissioner to stop enforcing "any monetary condition of release that results in detention solely by virtue of an arrestee’s inability to pay." The order said people can still be held, but the jail commissioner would have to prove that the person is a danger to the public or there is no other way to ensure the person would appear in court.

According to the lawsuit, the judge set bail in 98% of the studied cases without getting any information about the arrestee's ability to pay bail or if they are a public safety threat. In multiple cases, the arrestees were instructed not to talk to the judge.

Moving forward, arrestees will have a hearing with a judge within 48 hours of an arrest where they will have an opportunity to present and rebut evidence to determine if they need to be held. Additionally, all those currently detained will have the same hearing within seven days of this order.

The order is in response to a motion for a restraining order filed by inmates saying the city of St. Louis violated their constitutional rights by not considering their ability to pay before setting bail. The judge's order granted class-action status to that motion. 

That class includes "all arrestees who are or will be detained in the Medium Security Institution (the Workhouse) or the City Justice Center (CJC), operated by the City of St. Louis, post-arrest because they are unable to afford to pay a monetary release condition.”

RELATED: Captain at 'The Workhouse' says he was targeted, fired for complaining about conditions

RELATED: ‘We're letting them see for themselves’ | A look inside the ‘Workhouse’

RELATED: Former inmate shares insight to St. Louis Workhouse conditions