White House officials reportedly plotted in recent months to retaliate against so-called sanctuary cities by releasing detained immigrants in their jurisdictions, The Washington Post reported Thursday.

According to emails obtained by the Post, officials have put pressure on U.S. immigration authorities at least twice in the last six months to help them implement the plan, which they expected would wreak havoc on cities that won’t comply with President Donald Trump’s immigration crackdown.

“It was retaliation, to show them, ‘Your lack of cooperation has impacts,’ ” one of the Department of Homeland Security officials who spoke to the Post said. “I think they thought it would put pressure on those communities to understand, I guess, a different perspective on why you need more immigration money for detention beds.”

CNN also reported on some of the details of the proposition.

After the White House made the sanctuary city requests ― once in November and again in February ― whistleblowers with knowledge of the plan approached Congress with the information, the Post reported.

Trump personally urged Homeland Security Secretary Kirstjen Nielsen to carry out the plan to target the cities, though Nielsen resisted, CNN reported Thursday. Nielsen unexpectedly resigned from her post on Monday.

Trump aide Stephen Miller also urged senior officials in the Department of Homeland Security to make the plan happen, according to CNN.

A DHS spokesperson told HuffPost that the plan to release detained immigrants into sanctuary cities “was a suggestion that was floated and rejected, which ended any further discussion.”

Trump has been outspoken about how dangerous he believes undocumented immigrants are, once referring to some of them as “animals.” His claims come despite the lack of evidence that the presence of undocumented immigrants leads to an uptick in crime.

House Speaker Nancy Pelosi’s district in San Francisco, which has been a sanctuary city since the 1980s, was one of the Democratic strongholds the Trump administration wanted to target, the report said. Trump has repeatedly blamed her for blocking the funding he sought for his proposed wall along the U.S.-Mexico border. Her office denounced the plan.

“The extent of this Administration’s cynicism and cruelty cannot be overstated,” Pelosi spokeswoman Ashley Etienne told HuffPost on Thursday night. “Using human beings — including little children — as pawns in their warped game to perpetuate fear and demonize immigrants is despicable, and in some cases, criminal.”

California is also one of 20 states that have filed a legal challenge against Trump’s decision to declare a national emergency in order to fund the border wall.

Former housing secretary and 2020 presidential candidate Julián Castro was asked about the report at his CNN town hall on Thursday night and replied that “the cruelty of this administration never seems to end.”

“Now they’re talking about busing families to particular cities to target political opponents. You know, these folks want us to choose cruelty as a weapon against these people and against political opponents, and last week I released an immigration plan,” Castro said. “I’m calling on Americans to choose compassion, not cruelty.”

The White House didn’t immediately respond to a request for comment.

Carla Herreria and Sanjana Karanth contributed to this report.

This article has been updated with remarks by presidential candidate Julián Castro.