Updated

A small Arizona city has ended its role in an unusual contract that allowed the Immigration and Customs Enforcement agency to run a family detention center in Texas, where lawyers say a child became sick and died after her release.

The city of Eloy already had an agreement with ICE and the private detention company CoreCivic for a detention facility when it entered the contract in 2014 involving the South Texas Family Residential Center in Dilley.

A report by the Department of Homeland Security's Office of Inspector General in February slammed ICE over the agreement, saying it didn't follow federal procurement guidelines.

The report said ICE could have contracted directly with CoreCivic but instead created "an unnecessary 'middleman.'"

Eloy was the subject of a notice of claim — the precursor to a lawsuit — last month by attorneys for the mother of Mariee Juarez, a toddler who died after being released from Dilley.

"This is overdue action from the city of Eloy to separate itself from the operation and management of the ICE 'family detention' facility in Dilley, Texas," attorney R. Stanton Jones said in a statement.

He said the child fell ill as a result of the "unsafe and unsanitary conditions and then was denied proper medical care."

The 21-month-old girl died of viral pneumonitis, an inflammation of lung tissue. ICE said at the time that it takes the health, safety and welfare of detainees seriously and provides comprehensive medical care.

On Monday, the Eloy City Council voted to end that contract at the request of ICE, City Manager Harvey Krauss said. The city has netted about $1.5 million in revenue from the contract that was always intended to be temporary, he said. It will continue to contract with ICE for a detention center in Eloy.

"This was initiated by ICE, it wasn't initiated by us. We didn't have any control or say in that," Krauss said.

ICE officials have said they opted for the agreement with Eloy as a last-minute means to quickly open the Texas detention center because of a surge of families coming to the U.S. from Central America. The center opened in December 2014.

CoreCivic said the agreement is being moved to the Dilley. ICE spokeswoman Sarah Rodriguez said the agency is not commenting because of ongoing negotiations.

David L. Jordan, the Dilley city administrator, said it's still negotiating on the contract, but wouldn't comment further.

Associated Press writer Nomaan Merchant in Houston contributed to this report.