President Donald Trump announced Saturday that he would delay plans to begin mass immigration raids Sunday against undocumented families.

The president said on Twitter that "at the request of Democrats" the Immigration and Customs Enforcement agency (ICE) would delay the planned mass raids targeting people with deportation orders.

Two Department of Homeland Security officials told NBC News, however, that the raids were called off in large part because details of the plan had leaked to media. A second issue was that ICE did not have plans in place for detaining the 2,000 immigrants — mainly families — whom they were going to arrest and deport, the officials said.

Trump claimed on Twitter that he approved the delay so that Democrats and Republicans in Congress could work out a compromise on immigration policy — a deal that has so far long eluded the president and his allies. Trump said the deal would have to solve “the Asylum and Loophole problems at the Southern Border.”

If Congress is unable to strike a deal, “Deportations start!” he wrote.

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. If not, Deportations start! — Donald J. Trump (@realDonaldTrump) June 22, 2019

Speaker of the House Nancy Pelosi called Trump on Friday night to ask that he drop the plan for the raids, a source familiar with the matter told NBC News.

Pelosi in a statement on Saturday said she hoped that leaders of faith-based and community organizations would "call upon the President to stop this brutal action which will tear families apart and inject terror into our communities."

"These families are hard-working members of our communities and our country," Pelosi said. "The President’s action makes no distinction between a status violation and committing a serious crime. It is important that the President and our immigrant communities know that they have rights in America."

Julian Castro, a former secretary of Housing and Urban Development and a Democratic candidate for president, said in reaction to Trump's announced delay that the president was using threats against immigrant families as a political tool.

“This is bulls---,” Castro said at the South Carolina Democratic Convention on Saturday afternoon. “This is his bulls--- politics. People need to see through that and see that this guy is a political con-man.”

Download the NBC News app for breaking news and politics

Trump's announcement of the delay Saturday ended a week that began with his tweeting Monday that ICE would begin deporting "millions" of people whom he described as "illegal aliens who have illicitly found their way in to the United States.”

Then on Thursday an Associated Press report said that a team of attorneys had found that more than 60 children held at immigration facilities near El Paso were living in unhealthy and unsanitary conditions.

The lawyers found that many children had become sick with the flu, had been fed uncooked frozen food or rice and left without clean clothes or an opportunity to bathe for weeks.

"In my 22 years of doing visits with children in detention I have never heard of this level of inhumanity," Holly Cooper, an attorney who represents detained youth, told the Associated Press. "Seeing our country at this crucible moment where we have forsaken children and failed to see them as human is hopefully a wake up for this country to move toward change."

When news came out Friday that mass raids against undocumented families would start Sunday and that major cities, from Los Angeles to New York, could be targeted, local elected leaders protested.

Chicago Mayor Lori Lightfoot went so far as to order the city’s police department to remove ICE access to city databases related to federal immigration enforcement activities.

"Chicago will always be a welcoming city and a champion for the rights of our immigrant and refugee communities," Lightfoot said.