WASHINGTON (AP) — President Donald Trump on Saturday said he was postponing a nationwide immigration sweep to deport people living in the U.S. illegally, including families, saying he would give lawmakers time to work out border solutions.

The move came after House Speaker Nancy Pelosi had called Trump on Friday asking him to call off the operation. Separately, administration officials told The Associated Press that Immigration and Customs Enforcement was concerned that details leaked to the media could jeopardize its agents.

“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!”

Lawmakers are mulling 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 committee on a 30-1 vote. The bipartisan vote likely means that the Senate will take the lead in writing the legislation, which needs to pass into law before the House and Senate leave for vacation next week.

Pelosi called Trump on Friday night, according to a person familiar with the situation and not authorized to discuss it publicly. The person spoke on condition of anonymity.

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.”

Three administration officials told AP the operation had been delayed because of major concerns about officer safety after details of the sweep leaked to the media. The operation was 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 signal of the 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 hardline 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 tweeted Saturday morning hinting the operation was still on, saying the immigrants “that Ice (sic) will apprehend have already been ordered to be deported,” he wrote. “This means that they have run from the law and run from the courts.”

Earlier this week, he tweeted that an operation was upcoming and said the agency would begin to remove “millions” of people that were here illegally.

Later leaks in the media included sensitive law enforcement details, like the day it was to begin, Sunday, plus specific cities and other operational details.

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.

FILE – In this April 3, 2019, file photo, a couple who did not want to give their names embrace outside CVE Group as a bus from LaSalle Corrections Transport departs the facility in Allen, Texas. Immigrant families and advocates are warning about planned arrests around the country by the Immigration and Customs Enforcement agency. In Texas, ICE’S homeland security operations arrested 280 employees at a company in Allen, Texas, in April, saying it was their biggest worksite operation in a decade. (Smiley N. Pool/The Dallas Morning News via AP, File)

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 in 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.