New York City Mayor Bill de Blasio has taken a page from the Cher manual on backtracking and vowed to block Trump’s growing determination to send illegal immigrants from crowded detention centers to sanctuary cities like the Big Apple. And he says the law is on his side.

De Blasio made the statement on NY1 after Trump continued to threaten to send undocumented immigrants to so-called sanctuary cities on Monday. “It’s illegal. It is just plain illegal. We will meet him in court. We will beat him in court,” de Blasio said.

There’s no doubt Trump’s idea — which he reiterated a desire to move on as late Monday — is a political move; and, while savvy, is not without criticism, as Jason Riley writes at The Wall Street Journal:

Mr. Trump regularly complains that apprehended illegal immigrants are released into society while awaiting their court dates. It’s a legitimate gripe, but shipping immigrants to sanctuary cities would only increase the odds that they don’t show up for their hearings. And it will make those cities even more of a magnet for fake asylum seekers and others who shouldn’t be in the country. The frustration with cities that coddle illegal immigrants is understandable. Sanctuary policies make life easier for violent criminal immigrants and more dangerous for the law-abiding fellow immigrants on whom they prey most often. Yet the president seems more interested in punishing the Democratic politicians who typically run these cities, even if the results are counterproductive.

There’s also little doubt that the legality of such a move is questionable. Critics contend that the Department of Homeland Security is funded for certain actions — such as processing and detention of migrants — but that funds have not been appropriated for transporting illegals (which would be expensive) nor determining which cities would be be landing spots.

However, as the The Daily Signal suggests, ambiguity in the law works both ways.

Trump is bringing in new leadership for the Department of Homeland Security after forcing out Secretary Kirstjen Nielsen on April 7. Since the Times and others reported on the legal questions, Brandon Judd, president of the National Border Patrol Council, a labor union, and former ICE acting Director Thomas Homan both have said the move would be legal. A former Justice Department lawyer, Hans von Spakovsky, said no specific provision of law prevents it. “There’s no restriction, there’s no legal limit in federal immigration law that says the Department of Homeland Security can only release detained illegal aliens in particular locations,” von Spakovsky, now a senior legal fellow at The Heritage Foundation, said Monday night on “Lou Dobbs Tonight” on Fox Business Network. “I don’t see anything in the law that would prevent the president from doing this,” he said.

While it’s tempting to see Trump’s plan of moving illegal immigrants “to cities that say they want them,” as Ira Mehlman, spokesman for the Federation for American Immigration Reform told The Daily Signal, as nothing more than a game of political one-upmanship, there’s a practical reality to consider as well.

It’s known that the Obama administration was releasing illegal immigrants randomly and not tracking their movements, and were reticent to provide information as to how many were let go. Trump’s plan, at the very least, will lend itself to tracking how many illegals are being released and where exactly they go, at least initially.

And if de Blasio or any number of other lawmakers in sanctuary cities want to formally litigate the plan (if it ever even happens), they’ll be admitting on record that the situation at the border is more of a crisis than they’ve been pretending.

The good news is that while the White House says the sanctuary city release is an “option on the table,” they’re also adamant that cooperation with Democrats on immigration is preferred.

The bad news is that threatening a lawsuit is generally not a sign of a willingness to cooperate.