LOUISVILLE, Ky. (WDRB) -- Federal agents have taken custody of an inmate from Louisville Metro Corrections who apparently was mistakenly left in jail several months after serving a one-year sentence for domestic violence. 

On Monday, U.S. Immigration, Custom and Enforcement Officers (ICE) took custody of David Reyes, who was arrested in 2015 for rape and kidnapping. He eventually pleaded guilty to lesser charges of domestic violence, sexual misconduct involving a spouse and unlawful imprisonment. 

After his arrest, ICE agents placed a detainer on Reyes, identifying him as a person of interest. 

Metro Corrections spokesman Steve Durham said in a press release that the jail "failed to notify" ICE officials when Reyes completed his sentence in September 2016. And Reyes "remained in custody" until Monday, when jail officials told ICE about the inmate and he was "immediately" taken into federal custody. 

It is unclear why Reyes remained in Metro Corrections for the past five months. 

Court records show Reyes had "served out" his sentence in September. 

Rachel Carmona, an attorney for Reyes, said there was no question the jail had "unlawfully held" him for almost five months, until his family came to her and she notified a judge. 

"If I hadn't put in on the docket, how long would he have sat there?" Carmona said in an interview. She said Reyes and his family did not know what was going on and no one at the jail has provided an answer to them or District Court Judge Amber Wolf, who heard the case on Monday. 

"They gave us a big runaround," she said of jail officials. 

Durham wrote that Metro Corrections will "begin an internal audit of sentence calculation for individuals serving sentences and who have warrants or holds from other jurisdictions."

He did not return phone messages seeking more details. 

Metro Corrections has been under fire in recent months for alleged repeated failures to properly release inmates.

Attorneys for two former inmates have filed a federal lawsuit against the city and the jail's director claiming hundreds of inmates have been unlawfully imprisoned by being detained after judges ordered them released.

The lawsuit, filed earlier this month, on behalf of Jacob Healey and Larry Louis Hibbs Jr., claims "false imprisonments and unlawful detainments have been regularly" occurring at the jail. The suit is seeking class action status for "hundreds" of inmates impacted in the last year.

The suit asks a U.S. District Court judge to issue an injunction stopping the practice and requiring training and supervision to prevent false imprisonments.

The suit comes as Metro Corrections Director Mark Bolton and his top staffers prepare for a March contempt hearing ordered by a Jefferson District Court judge who alleges the jail is not following orders on releasing inmates.

On Jan. 27, Judge Stephanie Burke harshly criticized jail officials, telling them there was a "leadership problem" and an attitude from some top officials that they do not need to follow orders.

"I think this is a systemic problem," Burke told Bolton, Durham and Chief of Staff Dwayne Clark, among others. "There is a wide consensus, not just in this court but in others, among the (Bar Association), the court staff, the clerks, the sheriffs, that this is a problem and it's a daily problem. This is something that needs to be a collaborative effort to resolve."

Burke has cited 16 specific cases in which Metro Corrections is accused of not following orders, and she argues that between Jan. 4 and Jan. 20 of this year, the jail has failed to bring "numerous" defendants to their scheduled court dates.

Burke set the civil contempt hearing date for March 28. In civil contempt, a person is punished until they follow a judge's order, with possible jail time or fines.

Also, Bolton will appear before the Metro Council's Public Safety Committee on Wednesday to update them on "many issues," including jail crowing and staffing, according to a press release. It is unclear if Bolton will be questioned about improper releases. 

In Durham's press release on Monday, he said the jail routinely works with ICE officials before inmates of interest complete their state or local sentence.  Typically, immigration officials take the inmate into custody on or near the same day they are notified by the jail. But this time, Metro Corrections "failed" to notify ICE, Durham acknowledged. 

The press release comes on the same day that a social justice group delivered a petition to Mayor Greg Fischer asking that Louisville become a Sanctuary City. 

A Sanctuary City makes a promise to protect undocumented immigrants. This would mean Louisville would not prosecute people for breaking federal immigration law. 

Copyright 2017 WDRB Media. All rights reserved.