According to an internal government investigation, Immigration and Customs Enforcement pays the city of Eloy, Arizona, $438,000 per year to be the "unnecessary middleman" for a detention center in Dilley, Texas.

Immigration and Customs Enforcement (ICE) has been paying a city in Arizona almost half a million dollars a year since 2014 to act as a middleman in the agency’s contract with a private prison company to run an immigrant detention center in Texas, according to an internal government investigation.

Confused yet? You should be, because there’s nothing logical about this.

To make sense of this bizarre situation, uncovered by the Department of Homeland Security’s Office of Inspector General, it’s important to know that, out of the nation’s 203 immigrant detention centers, only 5 are owned and operated by ICE. The remainder are operated by private prison companies, or by cities that provide space for immigrant detainees in local jails. ICE pays the private prison companies and cities for this service with federal taxpayer money.

According to the Inspector General investigation, ICE contracted with the city of Eloy, Arizona, in 2006 to hold 1,500 immigrant detainees at the Eloy Detention Center. The city, in turn, contracted with the private prison company Corrections Corporation of America (CCA, now known as CoreCivic) to operate the detention center.

However, a “surge” of undocumented immigrants entering the country in 2014 meant that ICE needed more space for detainees—specifically families and unaccompanied children—that the Eloy Detention Center couldn’t provide, according to the investigation. So, ICE entered into negotiations with CCA to build and operate the South Texas Family Residential Center in Dilley, Texas, more than 900 miles from Eloy.

Where things get weird is that, instead of signing a new contract directly with CCA to operate the new facility, ICE instead modified its contract with Eloy, putting the Arizona city in charge of subcontracting with CCA to build and operate the Texas facility. ICE did this in spite of the fact that its own lawyers warned the agency that the plan “was not legally advisable,” according to the investigation.

According to ICE officials who responded to the investigation, Eloy was involved in the contract simply out of expediency because, they said, it would have taken longer to hammer out a “traditional procurement agreement.”

And so ICE pays the city of Eloy, Arizona, $438,000 per year to do, well, nothing at a detention center in Texas. The city’s “sole function” in the contract is to be an “unnecessary middleman,” according to the investigation.

This may be the least of it. The investigation found, “ICE has no assurance that it executed detention center contracts in the best interest of the Federal Government, taxpayers, or detainees.” Given ICE’s consistent secrecy surrounding immigrant detention centers, it’s difficult to know how much more taxpayer money the agency is just giving away.