WASHINGTON (AP) — President Donald Trump on Saturday delayed a nationwide immigration sweep to deport people living the United States illegally, including families, saying he would give lawmakers two weeks to work out solutions for the southern border.

The move came after House Speaker Nancy Pelosi called Trump on Friday asking him to call off the raids. But three administration officials said scrapping the operation was not just about politics. They said Immigration and Customs Enforcement leaders had expressed serious concerns that officers' safety would be in jeopardy because too many details about the raids had been made public.

The officials spoke on condition of anonymity to speak about private discussions.

"At the request of Democrats, I have delayed the Illegal Immigration Removal Process (Deportation) for two weeks to see if the Democrats and Republicans can get together and work out a solution to the Asylum and Loophole problems at the Southern Border," Trump wrote on Twitter. "If not, Deportations start!"

The operation, which sparked outrage and concern among immigrant advocates, had been expected to begin Sunday and would target people with final orders of removal, including families whose immigration cases had been fast-tracked by judges.

The cancellation was another sign of the Trump administration's difficulty managing the border crisis. The number of people crossing the U.S.-Mexico border has risen dramatically under Trump, despite his tough rhetoric and hard-line policies. Balancing a White House eager to push major operational changes with the reality on the ground is a constant challenge for the Department of Homeland Security.

Trump gave the first public word of the planned sweep earlier this week, saying in a tweet that an operation was coming up and the agency would begin to remove "millions" of people who were in the United States illegally. Later, leaks to the media included sensitive law enforcement details, such as the day it was to begin, Sunday, plus specific cities and other operational details.

On Saturday, ICE spokeswoman Carol Danko criticized the leaks in context of their potential impact on ICE personnel, saying in a statement that "any leaks telegraphing sensitive law enforcement operations is egregious and puts our officers' safety in danger."

Pelosi called Trump on Friday night and the two spoke for about 12 minutes, according to a person familiar with the situation and not authorized to discuss it publicly. She asked him to call off the raids and he said he would consider the request, the person said.

It's unclear what else was said during the call. But in a statement Saturday before the president's decision was announced, Pelosi appealed to the same compassion Trump expressed in declining to strike Iran because of the potential for lost lives.

"The President spoke about the importance of avoiding the collateral damage of 150 lives in Iran. I would hope he would apply that same value to avoiding the collateral damage to tens of thousands of children who are frightened by his actions," she said.

She called the raids "heartless."

Pelosi responded to Trump's announcement with her own tweet, saying: "Mr. President, delay is welcome. Time is needed for comprehensive immigration reform. Families belong together."

Halting the flow of illegal immigration has been Trump's signature campaign issue, but Congress has been unable to push his proposals into law with resistance from both Democrats and Republicans. Bipartisan talks over the immigration system have started and stalled but are again underway among some in the Senate.

Lawmakers are considering whether to give $4.6 billion in emergency funding to help border agencies struggling to manage a growing number of migrants crossing the border. The measure passed a Senate committee on a 30-1 vote. But the House is considering its own measure. Funding is running out and Congress is trying to approve legislation before the House and Senate recess next week.

Earlier Saturday, Trump hinted the operation was still on, saying the people ICE was looking for "have already been ordered to be deported."

"This means that they have run from the law and run from the courts," Trump said.

Coordinated enforcement operations take months to plan . Surprise is also an important element. ICE officers don't have a search warrant and are working from files with addresses and must go to people's home and ask to be let inside. Immigrants are not required to open their doors, and increasingly they don't. Officers generally capture about 30% to 40% of targets.

The planned operation was heavily criticized by Democratic lawmakers as cruel, and many local mayors said they would refuse to cooperate with ICE. Immigrant advocates stepped up know-your-rights campaigns.

Another complication is that ICE needs travel paperwork from a home country to deport someone, so immigrants often end up detained at least temporarily waiting for a flight. ICE was reserving hotel rooms for families in the event the operation went off as planned Sunday.

The adult population of detainees was 53,141 as of June 8, though the agency is only budgeted for 45,000. There were 1,662 in family detention, also at capacity, and one of the family detention centers is currently housing single adults.

Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.