Just days after he took office in 2017, President Donald Trump set out to make good on his campaign pledge to halt illegal immigration. In a pair of executive orders, he ordered “all legally available resources” to be shifted to border detention facilities and called for hiring 10,000 new immigration officers.

The logistical challenges were daunting, but as luck would have it, Immigration and Customs Enforcement already had a partner on its payroll: McKinsey & Company, an international consulting firm brought on under the Obama administration to help engineer an “organizational transformation” in the ICE division charged with deporting migrants who are in the United States unlawfully.

ICE quickly redirected McKinsey toward helping the agency figure out how to execute the White House’s clampdown on illegal immigration

But the money-saving recommendations the consultants came up with made some career ICE staff uncomfortable. They proposed cuts in spending on food for migrants, as well as on medical care and supervision of detainees, according to interviews with people who worked on the project for both ICE and McKinsey and 1,500 pages of documents obtained from the agency after ProPublica filed a lawsuit under the Freedom of Information Act.

McKinsey’s team also looked for ways to accelerate the deportation process, provoking worries among some ICE staff members that the recommendations risked short-circuiting due process protections for migrants fighting removal from the United States. The consultants, three people who worked on the project said, seemed focused solely on cutting costs and speeding up deportations — activities whose success could be measured in numbers — with little acknowledgment that these policies affected thousands of human beings.

In what one former official described as “heated meetings” with McKinsey consultants, agency staff members questioned whether saving pennies on food and medical care for detainees justified the potential human cost.

But the consulting firm’s sway at ICE grew to the point that McKinsey’s staff even ghostwrote a government contracting document that defined the consulting team’s own responsibilities and justified the firm’s retention, a contract extension worth $2.2 million. “Can they do that?” an ICE official wrote to a contracting officer in May 2017.

The response reflects how deeply ICE had come to rely on McKinsey’s assistance. “Well it obviously isn’t ideal to have a contractor tell us what we want to ask them to do,” the contracting officer replied. But unless someone from the government could articulate the agency’s objectives, the officer added, “what other option is there?” ICE extended the contract.

The New York Times reported last year that McKinsey ultimately did more than $20 million in consulting work for ICE, a commitment to one of the Trump administration’s most controversial endeavors that raised concerns among some of McKinsey’s employees and former partners. The firm’s global managing partner, Kevin Sneader, assured them in a 2018 email that the firm had never focused on developing, advising or implementing immigration policies. He said McKinsey “will not, under any circumstances, engage in work, anywhere in the world, that advances or assists policies that are at odds with our values.”

But the new documents and interviews reveal that the firm was deeply involved in executing policies fundamental to the Trump administration’s immigration crackdown. McKinsey’s recommendations for spending cuts went too far for some career ICE employees, and a number of the proposals were never implemented.

This article is co-published with The New York Times. Read the full article at Pro Publica.