© David J. Phillip/Associated Press An Immigration and Customs Enforcement agent as deportations were being carried out in November in Houston.

Nationwide raids to arrest thousands of members of undocumented families have been scheduled to begin Sunday, according to two current and one former homeland security officials, moving forward with a rapidly changing operation, the final details of which remain in flux. The operation, backed by President Trump, had been postponed, partly because of resistance among officials at his own immigration agency.

The raids, which will be conducted by Immigration and Customs Enforcement over multiple days, will include “collateral” deportations, according to the officials, who spoke on the condition of anonymity because of the preliminary stage of the operation. In those deportations, the authorities might detain immigrants who happened to be on the scene, even though they were not targets of the raids.

Sign Up For the Morning Briefing Newsletter

When possible, family members who are arrested together will be held in family detention centers in Texas and Pennsylvania. But because of space limitations, some might end up staying in hotel rooms until their travel documents can be prepared. ICE’s goal is to deport the families as quickly as possible.

The officials said ICE agents were targeting at least 2,000 immigrants who have been ordered deported — some as a result of their failure to appear in court — but who remain in the country illegally. The operation is expected to take place in at least 10 major cities.

The families being targeted crossed the border recently: The Trump administration expedited their immigration proceedings last fall. In February, many of those immigrants were given notice to report to an ICE office and leave the United States, the homeland security officials said.

Matthew Bourke, an ICE spokesman, said in a statement on Wednesday that the agency would not comment on specific details related to enforcement operations, to ensure the safety and security of agency personnel.

The threat of deportation has rattled immigrant communities across the country, prompted backlash from local politicians and police officials and stoked division inside the Department of Homeland Security — the agency that is charged with carrying out the deportations. The Trump administration’s goal is to use the operation as a show of force to deter families from approaching the southwestern border, the officials said.

While rare, such coordinated raids have occurred under previous administrations. Agents have expressed apprehensions about arresting babies and young children, officials have said. The agents have also noted that the operation might have limited success because word has already spread among immigrant communities about how to avoid arrest — namely, by refusing to open the door when an agent approaches one’s home. ICE agents are not legally allowed to forcibly enter a home.

Immigration defense lawyers are likely to file motions to reopen the families’ immigration cases, which would significantly delay, if not stop altogether, their removal from the United States.

For weeks last month, the ICE director at the time, Mark Morgan, signaled that agents would escalate efforts to round up families. Days before the operation was to begin, Mr. Trump forecast the plan on Twitter, blindsiding ICE agents whose safety officials feared would be compromised as a result.

In early June, the Department of Homeland Security’s acting secretary, Kevin K. McAleenan, told Mr. Morgan to call off the operation. Mr. McAleenan did not support the raids, officials said at the time, in part out of concern that undocumented parents could be separated from any of their children who are American citizens.

Mr. Morgan then directly lobbied Mr. Trump to move forward with the raids. He is now the commissioner of Customs and Border Protection, another arm of the Department of Homeland Security.

In a tense meeting with White House officials on June 21, two days before the raids were scheduled to begin, Mr. McAleenan again outlined the challenges of the operation, including the separation of families and the logistics of housing them until they can be removed. If undocumented parents are found to have children who are United States citizens, for example, ICE agents will need to wait with the children in a hotel room until a relative in the United States can claim them.

Homeland security officials also worried that many of the families that the administration had hoped to detain might have left the addresses known to ICE after Mr. Trump tweeted the agency’s plans.

Speaker Nancy Pelosi called Mr. Trump after his tweet and urged him to halt the operation, which in a statement hours later she described as “heartless.”

Mr. Trump then tweeted that he would delay the effort at the Democrats’ request. But he also threatened to resume the deportations if Democrats refused to join with Republican lawmakers to “work out a solution to the Asylum and Loophole problems at the Southern Border.”

Days later, the Senate passed a $4.6 billion humanitarian aid package for the border.

Migrant crossings have declined since May, when 144,200 migrants were taken into custody at the southwestern border — a 13-year high.

Last Friday, Mr. Trump said the raids would begin “fairly soon.”

“I say they came in illegally, and we’re bringing them out legally,” the president told reporters.

Maggie Haberman and Emily Cochrane contributed reporting.