For years, tens of thousands of people were detained at Rikers Island and other city jail facilities for hours or days after making bail, according to a class action lawsuit filed in federal district court in Manhattan.

To settle the suit, the city will pay $3,500 to anyone whose release was delayed by at least three hours between Oct. 4, 2014 and Oct. 21 of this year, an agreement filed earlier this month says.

More than 71,000 people will be eligible to receive settlement money, but an attorney who brought the suit believes there were as many as 94,000 instances of delayed releases, meaning some plaintiffs will be eligible to receive multiple payouts.

If a judge approves the agreement, the city could end up shelling out as much as $329 million.

"If you are able to make bail and you want to get out, but you have to stay in, first of all, as folks know, Rikers and other city jails are very dangerous places," the attorney, Debbie Greenberger, said. "But also, the things that you are responsible to handle on the outside, you can't do. So there's kids who aren't picked up from their bus. There are jobs that you lose or you get in trouble with because you're not showing up on time."

The settlement outlines the city Department of Correction's failure to release detainees in a time frame required by law.

"Though the legislative history of the Local Law made clear that DOC possessed the capacity to release individuals no later than three hours after their bail had been paid, DOC nonetheless detained incarcerated individuals for many hours or days beyond the three-hour threshold, without any legitimate governmental need," the agreement reads. "DOC refused to accept or process bail payments until an individual had completed processing at a DOC jail facility-a process that took 22 hours or more-even if the bail amount was available and presented to DOC."

In a statement provided to NY1 on Tuesday, a DOC spokesperson blamed "antiquated systems and processes" for the delays.

"Under [DOC] Commissioner [Louis] Molina's leadership, we remain laser-focused on leveraging technology, investing in staff, and implementing common-sense reform efforts to improve our jail operations for all who work and live here," the spokesperson said.