HOUSTON — The Harris County Commissioners Court approved a settlement in the historic bail reform lawsuit.

This means no misdemeanor defendant will be held in jail just because they can't afford their bond.

The vote passed 3-2 along party lines with Republican commissioners Jack Cagle and Steve Radack voting no. Commissioner Cagle wanted money included to help crime victims and witnesses with getting to court to testify and other needs. It was not part of the deal.

The deal locks down rules that Harris County judges had been implementing since March, that a misdemeanor arrest doesn't automatically equal jail time. Under the settlement, other defendants charged with certain crimes, like those related to family violence, DWI, some assaults, or are facing new charges while already out on bond, will face a judge for a possible bail determination.

Unlike the previous system, those defendants will be guaranteed free legal representation by the public defender's office. The deal also includes open hours court, reminders on court dates and a study on why defendants don't always show up to court.

"This landmark agreement is a historic step toward building a fair, effective criminal justice system that can act as a model for the nation," said Harris County Judge Lina Hidalgo. "This settlement is smart. It ensures that we are spending our resources on real public safety, rather than filling our jail with people who are only there because they're poor. Today marks a proud moment on our path toward justice."

The cost could be as high as $97 million over seven years. However, Judge Hidalgo said that's "a drop in the bucket" compared to what the county spends now. Commissioner Adrian Garcia pointed out that when he started as sheriff in 2009, the county was spending about the same amount every year to outsource inmates at the overcrowded jail -- 12,400 then compared to more than 8,000 now -- and deputy overtime at the jail.

“If we want to look at cost, let’s look at taxpayer waste, and let’s look at how crime did not plummet," Garcia said.

In 2017, a U.S. District Court judge ruled Harris County's bail system unconstitutional. The judge said it violated equal protection rights because there were essentially two justice systems - one for the rich and one for the poor. Now the vote will go back to the same federal judge for approval. A hearing is scheduled for Aug. 21.

This is a legal battle that's gone on for years. It all started with a federal lawsuit filed in 2016. It alleged Harris County's bail system allowed defendants with cash to post bail and go home while poor arrestees sat in jail.

RELATED: Concern over new bill to reform bail in Texas

One of the defendants was a 23-year-old woman who sat in jail for two days after she was charged with driving with a suspended license.

Harris County spent millions fighting the lawsuit at first, but when Judge Lina Hidalgo took office in January, officials worked to settle the case instead.

Similar lawsuits have been filed by civil rights groups in other states. So Harris County is on the forefront of a broader push to reform bail systems across the U.S.

Commissioner Rodney Ellis said officials are now focused on an ongoing lawsuit challenging Harris County's felony bond system. They make up the overwhelming majority of pretrial defendants in Harris County's jail.

Ellis acknowledged there will be more "carve-outs" in any possible settlement. However, he said one focus will be on those accused of state jail felonies, which he said are basically misdemeanors.

ALSO POPULAR ON KHOU.COM