Last Monday, when President Trump tweeted that his Administration would stage nationwide immigration raids the following week, with the goal of deporting “millions of illegal aliens,” agents at Immigration and Customs Enforcement were suddenly forced to scramble. The agency was not ready to carry out such a large operation. Preparations that would typically take field officers six to eight weeks were compressed into a few days, and, because of Trump’s tweet, the officers would be entering communities that now knew they were coming. “It was a dumb-shit political move that will only hurt the agents,” John Amaya, a former deputy chief of staff at ICE, told me. On Saturday, hours before the operation was supposed to start in ten major cities across the country, the President changed course, delaying it for another two weeks.

On Sunday, I spoke to an ICE officer about the week’s events. “Almost nobody was looking forward to this operation,” the officer said. “It was a boondoggle, a nightmare.” Even on the eve of the operation, many of the most important details remained unresolved. “This was a family op. So where are we going to put the families? There’s no room to detain them, so are we going to put them in hotels?” the officer said. On Friday, an answer came down from ICE leadership: the families would be placed in hotels while ICE figured out what to do with them. That, in turn, raised other questions. “So the families are in hotels, but who’s going to watch them?” the officer continued. “What happens if the person we arrest has a U.S.-citizen child? What do we do with the children? Do we need to get booster seats for the vans? Should we get the kids toys to play with?” Trump’s tweet broadcasting the operation had also created a safety issue for the officers involved. “No police agency goes out and says, ‘Tomorrow, between four and eight, we’re going to be in these neighborhoods,’ ” the officer said.

The idea for the operation took hold in the White House last September, two months after a federal judge had ordered the government to stop separating parents and children at the border. At the time, the number of families seeking asylum was rising steadily, and Administration officials were determined to toughen enforcement. A D.H.S. official told me that, in the months before the operation was proposed, “a major focus” of department meetings “was concern about the fact that people on the non-detained docket”—asylum seekers released into the U.S. with a future court date—“are almost never deported.” By January, a tentative plan had materialized. The Department of Justice developed a “rocket docket” to prioritize the cases of asylum seekers who’d just arrived in the country and missed a court date—in their absence, the government could swiftly secure deportation orders against them. D.H.S. then created a “target list” of roughly twenty-five hundred immigrant family members across the country for deportation; eventually, the Administration aimed to arrest ten thousand people using these methods.

From the start, however, the plan faced resistance. The Secretary of D.H.S., Kirstjen Nielsen, argued that the arrests would be complicated to carry out, in part because American children would be involved. (Many were born in the U.S. to parents on the “target list.”) Resources were already limited, and an operation on this scale would divert attention from the border, where a humanitarian crisis was worsening by the day. The acting head of ICE, Ron Vitiello, a tough-minded former Border Patrol officer, shared Nielsen’s concerns. According to the Washington Post, these reservations weren’t “ethical” so much as logistical: executing such a vast operation would be extremely difficult, with multiple moving pieces, and the optics could be devastating. Four months later, Trump effectively fired them. Vitiello’s replacement at ICE, an official named Mark Morgan—who’s already been fired once by Trump and regained the President’s support after making a series of appearances on Fox News—subsequently announced that ICE would proceed with the operation.

Late last week, factions within the Administration clashed over what to do. The acting secretary of D.H.S., Kevin McAleenan, urged caution, claiming that the operation was a distraction and a waste of manpower. Among other things, a $4.5 billion funding bill to supply further humanitarian aid at the border has been held up because Democrats worried that the Administration would use the money for enforcement operations. McAleenan had been meeting with members of both parties on the Hill, and there appeared to be signs of progress, before the President announced the ICE crackdown. According to an Administration official, McAleenan argued that the operation would also threaten a string of recent gains made by the President. The Trump Administration had just secured a deal with the Mexican government to increase enforcement at the Guatemalan border, and it expanded a massive new program called Remain in Mexico, which has forced some ten thousand asylum seekers to wait indefinitely in northern Mexico. “Momentum was moving in the right direction,” the official said.

On the other side of the argument were Stephen Miller, at the White House, and Mark Morgan, at ICE. In the days before and after Trump’s Twitter announcement, Morgan spoke regularly with the President, who was circumventing McAleenan, Morgan’s boss. In meetings with staff, Morgan boasted that he had a direct line to the President, according to the ICE officer, who told me it was highly unusual for there to be such direct contact between the agency head and the White House. “It should be going to the Secretary, which I find hilarious, actually, because Morgan was already fired once by this Administration,” the officer said.

Over the weekend, the President agreed to halt the operation. But it’s far from certain whether McAleenan actually got the upper hand. Officials in the White House authorized ICE to issue a press release insinuating that someone had leaked important details about the operation and therefore compromised it. “Any leak telegraphing sensitive law-enforcement operations is egregious and puts our officers’ safety in danger,” an ICE spokesperson said late Saturday afternoon. This was a puzzling statement given that it was Trump who first publicized the information about the operation. But the White House’s line followed a different script: some members of the Administration, as well as the former head of ICE, Thomas Homan, were publicly accusing McAleenan of sharing information with reporters in an attempt to undermine the operation.

For Homan, his involvement in the Administration’s internal fight marked an unexpected return to the main stage. Last year, he resigned as acting head of ICE after the Senate refused to confirm him to the post. Earlier this month, Trump announced, on Fox News, that Homan would be returning to the Administration as the President’s new border tsar, but Homan, who hadn’t been informed of the decision, has remained noncommittal. Still, according to the Administration official, Homan and the President talk by phone regularly. Over the weekend, Homan, who has since become an on-air contributor to Fox News, appeared on television to attack McAleenan personally. “You’ve got the acting Secretary of Homeland Security resisting what ICE is trying to do,” he said.