President Trump abruptly suspended his wide-ranging threat to deport “millions” of undocumented immigrants starting Sunday, demanding that Democrats and Republicans forge a plan to stanch the record flows of asylum-seeking families across the southern border into the United States.

Trump had announced the raids Monday in a surprise tweet that ignited a frenzy of fear in immigrant communities nationwide and drew criticism from law enforcement and elected officials in California, New York and other states. Then, in a move that has become a hallmark of his chaotic presidency, he reversed the plan in a tweet Saturday, mere hours before the raids were to begin.

Trump tweeted that he had “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.”

“If not, Deportations start!” he wrote.

In his tweet, Trump said “Democrats” had asked him to hold off on the raids. According to a person familiar with the call, who like others interviewed for this report spoke on the condition of anonymity, House Speaker Nancy Pelosi (D-Calif.) called Trump on Friday night and asked him to call off the raids. They spoke for about 10 minutes.

Democratic lawmakers celebrated the decision. In a tweet, Pelosi wrote that the delay “is welcome.”

“Families belong together,” she tweeted.

Trump’s eleventh-hour reversal and warning to Democrats mirrored his strategy earlier this month to push the Mexican government to launch a crackdown on Central American migrants passing through that country en route to the United States, postponing for 45 days his threat to impose tariffs. Since the June 7 agreement, Mexico has deployed elements of its national guard to the country’s southern border and has arrested more migrants. Unauthorized border crossings into the United States have shown signs of decline for the first time this year.

Trump administration officials had sought to cement those efforts with ramped-up enforcement in the interior of the United States, although the actual plans were to target thousands of migrant family members, not millions.

Democratic city officials, who had spoken out strongly against the tactic and launched efforts to aid residents, celebrated Trump’s delay Saturday. “Glad to hear,” Houston Police Chief Art Acevedo, a member of the Homeland Security Advisory Council, tweeted Saturday. “Rhetoric that causes fear & panic & pushes folks further into the dark places all at risk.”

But others — including Democratic presidential hopefuls — expressed frustration that Trump had frightened immigrants nationwide, making them fearful of going about their normal activities.

“This was another bait-and-switch,” New York Mayor Bill de Blasio told reporters after speaking at the South Carolina Democratic Party convention. “He creates a crisis, and then he says, ’Oh, let’s solve this crisis! Make a deal with me!’ It was ludicrous that he would ever be able to remove 11 million people from the United States of America. But the painful, cruel joke was that a lot of people felt a lot of fear over it.”

“Who knows what he’s going to do?” said former congressman Beto O’Rourke (D-Tex.) before speaking at the convention. “What he’s certainly attempting to accomplish is to distract us from the fact that there are kids today in border detention centers [sleeping] on cold concrete, with aluminum blankets, in the dirtiest, most unhumane conditions.”

U.S. Immigration and Customs Enforcement, which has planned the raids amid a highly unusual burst of publicity beforehand, called Saturday for tighter rules.

“No American citizen can get away with breaking the law or violating a court order — and neither should illegal aliens,” said ICE spokeswoman Carol Danko. “If Congress does not change the laws to ensure illegal aliens can be promptly removed at the southern border, there is no alternative but to continuously arrest these fugitive aliens in the interior.”

More than 675,000 migrants have arrived at the border so far in the fiscal year, with more than 144,000 migrants taken into custody in May alone, according to U.S. Customs and Border Protection.

The majority of those taken into custody at the border are in family groups — typically parents and children — and almost all are quickly released in the United States to await immigration court hearings because of overcrowding in federal holding facilities and legal limits on how long the government can detain children, frustrating Trump and his campaign promises to curb illegal immigration.

Advocates for immigrants say the families are fleeing horrendous conditions in Central America and other regions, and are allowed under federal law to seek asylum.

Pelosi called Trump about 7:20 p.m. Friday and asked him to call off the planned raids, according to a person familiar with the conversation.

Although Trump framed the postponement as a way to prod Congress toward a deal on overhauling the nation’s asylum laws, the reality was that the administration’s planned raids were threatening billions of dollars in new funding that lawmakers were set to approve in the coming weeks to address the humanitarian challenges at the border, including widespread crowding and unsanitary conditions for children.

The House and Senate had each been proceeding on emergency spending legislation to provide an additional $4.5 billion, mostly for the Departments of Health and Human Services and Homeland Security. House Democrats formally introduced their package Friday, which is set for a vote Tuesday; a Senate panel approved its version in committee this week, and Senate Majority Leader Mitch McConnell (R-Ky.) had said he would put that bill up for a floor vote in the coming week.

But members of the influential Congressional Hispanic Caucus already had been pushing for more restrictions on how the additional money could be spent and pointed to the planned raids as an example of immigration enforcement policy that they were vehemently opposed to funding.

Had the raids gone ahead, they would have jeopardized the future of the emergency money that the Trump administration had requested from Congress weeks ago, Democratic officials said.

Rep. Joaquin Castro (D-Tex.), the chairman of the Congressional Hispanic Caucus, told The Washington Post on Saturday that the group was continuing to evaluate the House Democrats’ border spending package through the weekend, but that Trump’s “mass deportation threats complicated the process tremendously.”

“The threat to knock and drag people away from their families and out of their communities shouldn’t be a negotiation tactic for an American president,” Castro said.

The Office of Refugee Resettlement, the HHS agency that cares for unaccompanied migrant children, will run out of funding at the end of this month without congressional action.

Separate from the spending bills, two influential senators — Lindsey O. Graham (R-S.C.) and Richard J. Durbin (D-Ill.) — are discussing potential changes to asylum laws that, paired with the additional funding, could help address the situation at the southern border. The two senators met quietly with Jared Kushner, the president’s son-in-law and White House senior adviser, earlier this week on the issue.

Trump’s decision to postpone the “family op” also eased growing tensions within Department of Homeland Security agencies over the timing and the wisdom of launching a large-scale roundup Sunday in major U.S. cities.

ICE acting director Mark Morgan has been speaking publicly for weeks about his determination to enforce deportation orders obtained for recently arrived families as part of a targeted, expedited court docket. Morgan and other senior ICE officials have been eager to move forward with their plan to conduct highly visible, synchronized mass arrests, arguing that such a tactic will help to deter illegal crossings at the border.

Kevin McAleenan, the DHS acting secretary, had been advocating for a narrower, more-limited operation, and he repeatedly warned that a wide-net approach raised the risk of family separations that would outrage Democrats and reinforce negative public perceptions of U.S. immigration enforcement efforts.

McAleenan has also made inroads with Democrats on Capitol Hill in recent hearings on the crisis.

With the president’s announcement, McAleenan appears to have prevailed in urging a delay to the family-arrest plan in hopes of getting Democrats to agree to close “loopholes” in the U.S. immigration system that he and other DHS officials say are at the root of the crisis, because they allow parents who cross the border illegally with children to largely avoid detention and deportation.

Colby Itkowitz and David Weigel contributed to this report.

Read more:

ICE raids targeting migrant families slated to start Sunday in major U.S. cities

New ICE chief says agency plans to target more families for deportation