A group of Bronx residents who claimed that the state criminal courthouse was so poorly managed they were being denied their constitutional right to a speedy trial have agreed to settle their proposed class-action suit amid signs of improvements, according to court filings.

Since the Manhattan federal lawsuit was filed in 2016, misdemeanor cases pending for more than a year have dropped to 513 from 2,378, lawyers for the plaintiffs said. Misdemeanor cases pending for more than two years fell to 64 from 538.

The settlement calls for the plaintiffs to halt their lawsuit for four years as they monitor disposition times. If data shows worse backlogs, they will reopen the case, they said.

“I think success is parity with the other boroughs,” said Jennifer Brown of Morrison & Foerster, one of their lawyers.