President Donald Trump said Friday he is "giving very strong consideration" to a plan to bus detained immigrants to so-called sanctuary cities as a way to retaliate against Democrats.

"We'll bring them to sanctuary city areas and let that particular area take care of it," Trump told reporters at the White House. "They say we have open arms, they're always saying they have open arms, let's see if they have open arms."

The president also said he would send more troops to the border and painted the growing number of asylum seekers seeking refuge in the U.S. — many of them families with young children who cannot be imprisoned for a long period of time under current law — as a security problem.

Due to the fact that Democrats are unwilling to change our very dangerous immigration laws, we are indeed, as reported, giving strong considerations to placing Illegal Immigrants in Sanctuary Cities only.... — Donald J. Trump (@realDonaldTrump) April 12, 2019

The president said he was weighing the idea because Democrats had blocked his efforts to change the country's "very dangerous immigration laws."

The president's statement came after a former Department of Homeland Security official said the plan, first reported by The Washington Post on Thursday night, was ultimately scrapped when it was determined to be "so illegal." A White House official who confirmed the broad outlines of the proposal Friday morning pushed back on the idea that it was meant as retaliation toward political rivals, however, calling that "absolutely ridiculous."

The official insisted the White House had never pressured Immigration and Customs Enforcement to put the plan in motion, but simply floated it to officials at the agency.

DHS on Thursday night told NBC News the proposal had been "a suggestion that was floated and rejected, which ended any further discussion."

The White House official confirmed the idea came up twice — initially as a query to ICE about the possibility, and later to inquire why it wouldn't be legally doable. Matthew Albence, who starts Friday as acting head of ICE, was involved in the assessment of the plan and the ultimate conclusion that it would not be feasible.

The Post quoted DHS officials as saying the administration sought to release detainees in the San Francisco-based district of House Speaker Nancy Pelosi, D-Calif., and in other strongly Democratic districts. It said the White House told ICE that the plan was partly meant to conserve jail space but also partly to "send a message to Democrats."

A source familiar with the plan told NBC News it was designed to "somehow hurt Pelosi."

Pelosi responded Friday, "It is just another notion that is unworthy of the presidency of the United States and disrespectful, the challenges we face as a country, as a people to address who we are — a nation of immigrants."

Following Trump's tweet that his administration was once more weighing the idea, White House principal deputy press secretary Hogan Gidley said in a statement that Democrats "should be working with the Administration to find the best ways to transport those illegal aliens that are already set for release, into communities in their states and districts.”

Another source, the former DHS official, told NBC News of the Trump administration's original thinking: "Why release (migrants) into Yuma or Phoenix when you can release them in San Francisco where they want them?"

White House senior policy adviser Stephen Miller at a Republican dinner in Columbus, Ohio, in August. Leah Millis / Reuters file

The Post reported that two DHS whistleblowers independently reported the busing plan to Congress and that several DHS officials confirmed their accounts. Two DHS officials said Stephen Miller, a senior policy adviser who is widely reported to have assumed control of U.S. border policy, discussed the proposal with ICE, according to The Post.

"Sanctuary cities" is a term used to describe jurisdictions that limit or ban cooperation with federal immigration authorities. Trump has accused Democrats of trying to "turn America into one giant sanctuary city for violent criminals and MS-13 and other gang killers."