— Immigration officials fired back at the Orange County sheriff Wednesday afternoon during a battle over his jail releasing a man who was supposed to be deported.

In a news release, U.S. Immigration and Customs Enforcement officials accused the Orange County Detention Center of improperly releasing Udiel Aguilar-Castellanos, who had served his time for a child sex offense but had a federal immigration detainer.

Aguilar-Castellanos walked out of the detention center on June 27 after pleading guilty in court to the sexual battery of an 11-year-old girl. The judge ruled he had more than served his time, but ICE said he should have never been released.

"Anytime you're releasing, allowing criminals to be released back into the communities where they committed these crimes, it doesn't make sense to do that," said Joe Sifuentez, the ICE deputy field office director.

Aguilar-Castellanos had been under an immigration detainer since the day of his arrest in September 2017.

On Wednesday, ICE officials blasted the jail, saying detention officers had an obligation to keep him in custody.

"It's often said that it's political, and I'll leave it at that," Sifuentez said.

Orange County Sheriff Charles Blackwood fired back at ICE saying, "Aguilar spent close to 300 days in custody awaiting resolution of his charges. At any point during that time, Immigration and Customs Enforcement was able to assume custody of Mr. Aguilar; however, that option was not exercised.

"Prior to Aguilar's release, Major Randy Hawkins of the Orange County Detention Center contacted the Department of Homeland Security by telephone at the phone number provided in the detainer with no response."

WRAL News asked ICE for a response following Blackwood's comments.

"What is not in dispute is the sheriff's major failed to contact ICE to let us know he had an egregious criminal offender he was about to return to community," Sifuentez said.

When Sifuentez was asked why ICE didn't pick Aguilar-Castellanos up during the 10 months he sat in the Orange County jail, he said they generally wait until the local court process ends.

In a similar case, the Orange County Detention Center released Jonathan Escobedo from custody on May 31 after a District Court judge sentenced him to time served, despite having an immigration detainer and a warrant of removal/deportation served on him, Blackwood said.

"Escobedo spent close to 200 days in custody awaiting resolution of his charges. At any point during that time, ICE was able to assume custody of Mr. Escobedo; however, that option was not exercised," he said.