President Donald Trump listens to South Korean President Moon Jae-in speak during a meeting in the Oval Office of the White House on Thursday in Washington. Credit: Evan Vucci | AP

WASHINGTON — White House officials have tried to pressure U.S. immigration authorities to release detainees onto the streets of “sanctuary cities” to retaliate against President Donald Trump’s political adversaries, according to Department of Homeland Security officials and email messages reviewed by The Washington Post.

Trump administration officials have proposed transporting detained immigrants to sanctuary cities at least twice in the past six months — once in November, as a migrant caravan approached the U.S. southern border, and again in February, amid a standoff with Democrats over funding for Trump’s border wall.

House Speaker Nancy Pelosi’s district in San Francisco was among those the White House wanted to target, according to Homeland Security officials. The administration also considered releasing detainees in other Democratic strongholds.

White House officials first broached the plan in a Nov. 16 email, asking officials at several agencies whether members of the caravan could be arrested at the border and then bused “to small- and mid-sized sanctuary cities,” places where local authorities have refused to hand over illegal immigrants for deportation.

The White House told U.S. Immigration and Customs Enforcement that the plan was intended to alleviate a shortage of jail space but also served to send a message to Democrats. The attempt at political retribution raised alarm within ICE, with a top official responding that it was rife with budgetary and liability concerns, and noting that “there are PR risks as well.”

After the White House pressed again in February, ICE’s legal department rejected the idea as inappropriate and rebuffed the administration.

A White House official and a spokesman for the Homeland Security sent nearly identical statements to The Post on Thursday, indicating that the proposal is no longer under consideration.

“This was just a suggestion that was floated and rejected, which ended any further discussion,” the White House statement said.

Pelosi’s office criticized the plan.

“The extent of this administration’s cynicism and cruelty cannot be overstated,” Pelosi spokeswoman Ashley Etienne said. “Using human beings — including little children — as pawns in their warped game to perpetuate fear and demonize immigrants is despicable.”

Trump has made immigration a central aspect of his administration, and he has grown increasingly frustrated at the influx of migrants from Central America. He often casts them as killers and criminals who threaten U.S. security, pointing to cases in which immigrants have killed U.S. citizens — including a notable case on a San Francisco pier in 2015. And he has railed against liberal sanctuary city policies, saying they endanger Americans.

“These outrageous sanctuary cities are grave threats to public safety and national security,” Trump said on Dec. 7, in a speech to the Safe Neighborhoods Conference in Kansas City, Missouri, less than a month after the White House asked ICE about moving detainees to such cities. “Each year, sanctuary cities release thousands of known criminal aliens from their custody and right back into the community. So they put them in, and they have them, and they let them go, and it drives you people a little bit crazy, doesn’t it, huh?”

The White House believed it could punish Democrats — including Pelosi — by busing ICE detainees into their districts before their release, according to two Homeland Security whistleblowers who independently reported the busing plan to Congress. One of the whistleblowers spoke with The Post, and several Homeland Security officials confirmed the accounts. They spoke on the condition of anonymity to discuss internal deliberations.

Senior Trump adviser Stephen Miller discussed the proposal with ICE, according to two Homeland Security officials. Matthew Albence, who is ICE’s acting deputy director, immediately questioned the proposal in November and later circulated the idea within his agency when it resurfaced in February, seeking the legal review that ultimately doomed the proposal. Miller and Albence declined to comment Thursday.

Miller’s name did not appear on any of the documents reviewed by The Post. But as White House senior adviser on immigration policy, officials at ICE understood that he was pressing the plan.

Trump has been demanding aggressive action to deal with the surge of migrants, and many of his administration’s proposals have been blocked in federal court or, like the family separation policy last year, backfired as public relations disasters.

Homeland Security officials said the sanctuary city request was unnerving, and it underscores the political pressure Trump and Miller have put on ICE and other Homeland Security agencies at a time when the president is furious about the biggest border surge in more than a decade.

“It was basically an idea that Miller wanted that nobody else wanted to carry out,” said one congressional investigator who has spoken to one of the whistleblowers. “What happened here is that Stephen Miller called people at ICE, said if they’re going to cut funding you’ve got to make sure you’re releasing people in Pelosi’s district and other congressional districts.”

The idea of releasing immigrants into sanctuary cities was not presented to Ronald Vitiello, the agency’s acting director, according to one Homeland Security official familiar with the plan. Last week the White House rescinded Vitiello’s nomination to lead ICE, giving no explanation, and Vitiello submitted his resignation Wednesday, ending his 30-year-career.

Trump told reporters the following day he wanted to put someone “tougher” at ICE. Homeland Security officials said they do not know whether ICE’s refusal to adopt the White House’s plan contributed to Vitiello’s removal. His departure puts Albence in charge of the agency as of Friday.

The White House proposal reached ICE first in November as a highly publicized migrant caravan was approaching the United States. May Davis, deputy assistant to the president and deputy White House policy coordinator, wrote to officials with U.S. Customs and Border Protection, ICE, and the Department of Homeland Security with the subject line: “Sanctuary City Proposal.”

“The idea has been raised by 1-2 principals that, if we are unable to build sufficient temporary housing, that caravan members be bussed to small- and mid-sized sanctuary cities,” Davis wrote, seeking responses to its operational and legal viability. “There is NOT a White House decision on this.”

Albence replied that such a plan “would create an unnecessary operational burden” on an already strained organization and raised concerns about its appropriateness, writing: “Not sure how paying to transport aliens to another location to release them — when they can released on the spot — is a justified expenditure. Not to mention the liability should there be an accident along the way.”

The White House pushed the issue a second time in the midst of the budget standoff in mid-February, according to Homeland Security officials, and on the heels of a bitterly partisan 35-day government shutdown over Trump’s border wall plan. The White House discussed the immigrant release idea as a way to punish Democrats standing in the way of funding additional detention beds.

ICE detainees with violent criminal records are not typically released on bond or other “alternatives to detention” while they await a hearing with an immigration judge, but there have been instances of such detainees being released.

The White House urged ICE to channel releases to sanctuary districts, regardless of whether immigrants had any ties to those places.

“It was retaliation, to show them, ‘Your lack of cooperation has impacts,’” one of the Homeland Security officials said, summarizing the rationale. “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.”

Senior officials at ICE did not take the proposal seriously at first, but as the White House exerted pressure, ICE’s legal advisers were asked to weigh in, Homeland Security officials said.

A formal legal review was never completed, according to two Homeland Security officials familiar with the events, and senior ICE attorneys told Albence and others that the plan was inappropriate and lacked a legal basis.

“If we would have done that, we would have had to expend transportation resources, and make a decision that we’re going to use buses, planes, etc. to send these aliens to a place for whatever reason,” a senior Homeland Security official said. “We had to come up with a reason, and we did not have one.”

The proposal faded when House Democrats ultimately relented on their demand for a decrease in the number of detention beds, a final sticking point in budget talks between the White House and House Democrats.

The number of immigrant detainees in ICE custody has approached 50,000 in recent months, an all-time high that has further strained the agency’s budget. Those include immigrants arrested in the U.S. interior, as well as recent border-crossers transferred from Border Patrol. With unauthorized migration at a 12-year-high, the vast majority of recent migrants — and especially those with children — are quickly processed and released with a notice to appear in court, a system that Trump has derided as “catch and release.”

The process has left Trump seething, convinced that immigration officials and the Homeland Security more broadly should adopt a harsher approach.

Vitiello’s removal from ICE last week was followed Sunday by the ouster of Homeland Security Secretary Kirstjen Nielsen, who lost favor with Trump and Miller by repeatedly warning the White House that the administration’s policy ideas were unworkable and likely to be blocked by federal courts.

The sanctuary city proposal ran contrary to ICE policy guidelines, as well as legal counsel. ICE officials balked at the notion of moving migrants to detention facilities in different areas, insisting that Congress only authorizes the agency to deport immigrants, not relocate them internally, according to Homeland Security officials.

The plan to retaliate against sanctuary cities came just after Trump agreed to reopen the government in late January, following a five-week shutdown over wall funding. The president gave lawmakers three weeks to come up with a plan to secure the border before a second fiscal deadline in mid-February.

During the talks, Republicans and Democrats sparred over the number of detention beds, with House Democrats pressing for a lower number amid pressure from their left flank.

It was during that mid-February standoff that one whistleblower came to Congress alleging that the White House was considering a plan to punish Democrats if they did not relent on ICE funding for beds. A second official independently came forward after that.

According to both, there were at least two versions of the plan being considered. One was to move migrants who were already in ICE detention to the districts of Democratic opponents. The second option was to bus migrants apprehended at the border to sanctuary cities, such as New York, Chicago and San Francisco.

Washington Post writer Josh Dawsey contributed to this report.