Donald Trump has said he is considering releasing “illegal immigrants” in Democratic strongholds to punish his opponents for inaction on border security.

The President’s remarks came just hours after White House and Homeland Security officials insisted the idea had been rejected as fast as it had been proposed.

“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,” Mr Trump tweeted.

He added: “The Radical Left always seems to have an Open Borders, Open Arms policy – so this should make them very happy!”

He told reporters later on Friday he was “strongly looking at” the idea.

“They’re always saying they have open arms. Let’s see if they have open arms,” he said.

His comments, which appeared to catch officials at the Department of Homeland Security off guard, came as critics condemned news that the White House had at least twice considered a plan to release detained immigrants into so-called sanctuary cities as an effort to use migrants as pawns to go after political opponents.

“Sanctuary cities” are places where local authorities do not cooperate with Immigration and Customs Enforcement officials, denying information or resources that would help ICE round up for deportation people living in the country illegally.

They include New York City and San Francisco, home city of House Speaker Nancy Pelosi, who on Friday called the idea “unworthy of the presidency of the United States and disrespectful of the challenges that we face as a country, as a people, to address who we are — a nation of immigrants”.

The idea of pressing immigration authorities to embrace the plan was discussed in November and then again in February as the Trump administration struggled with a surge of migrants at the border, according to sources.

Homeland Security and ICE lawyers quickly rejected the proposal, the sources said, and it was dropped on the grounds that it was complicated, too expensive and a misuse of funds.

Earlier on Friday, both the Department of Homeland Security and a White House official insisted, in nearly identical statements, that the plan was dead on arrival.

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

The plan, which was first reported by the Washington Post, is one of many ideas considered by an increasingly frustrated White House in recent months as Mr Trump has railed against the growing number of Central American migrant families crossing the southern border.

Officials say they are running out of options, and have proposed and recycled numerous ideas that have never come to fruition.

Mr Trump in recent weeks has discussed the idea of renewing his administration’s controversial family separation policy.

And he and aides are weighing forcing asylum-seeking families to choose between being detained together as their cases make their way through the courts or sending their children to government-run shelters.