President Trump is gearing up to tackle one of his marquee campaign promises: His pledge to target so-called sanctuary cities.

He reportedly plans to sign an executive order Wednesday to target the (mostly liberal) cities and counties that refuse to agree to hand over illegal immigrants to the federal government for deportation, especially if they don't agree on why Trump's administration wants to deport them. (Most, if not all, leaders in these cities have said they will hand over immigrants charged with serious crimes like murder.)

Sanctuary cities are one of the most high-profile acts of defiance for a Trump presidency, and he has indicated he has a zero-tolerance policy for these cities and every intention of ending their deportation protections. Except, that might be easier said than done. Immigration experts say Trump could run up against constitutional, geographic and even legal challenges in trying to force these cities to stop openly flouting him.

Sanctuary laws are under scrutiny again after a murder in San Francisco brought the city's policy into the national spotlight. (Jayne W. Orenstein and Osman Malik/The Washington Post)

First, the geographic challenge. Trump could leave closing down these cities up to the states. Republicans control both the state legislative chamber and governors' mansion in 25 states. Texas state GOP lawmakers introduced a bill in December to cut off state funding to sanctuary cities, hoping to follow in the footsteps of North Carolina, which in 2015 became the first (and so far only) state to effectively ban them.

This month, Texas Gov. Greg Abbott (R) is in a high-profile show down with the new sheriff of Travis County, threatening to cut off some $1.8 million in state grant money for her department unless she agrees to cooperate with all deportation requests.

But apart from North Carolina and Texas, immigration experts have a hard time seeing where else a ban might gain momentum. Most cities that let local law enforcement decide whether to hand immigrants to hand over to federal authorities for deportation  are in Democratic-controlled states.

"A lot of the other Republican states don't have large cities or large number of immigrants, so it's just not an issue in a lot of these GOP-controlled states," said Alex Nowrasteh, an immigration policy analyst with the libertarian Cato Institute. (A bill in Texas failed in the past few years in part because there were no sanctuary cities to ban.)

Trump could just ask Congress to pass a law cutting off funding for sanctuary cities. Except sanctuary cities have never really been a priority for Republican congressional leadership, which seems much more focused on repealing Obamacare and tax reform (and, when it comes to immigration, securing the border --  a whole other headache for Republicans).

Plus, Senate Democrats successfully blocked two sanctuary city bills in Congress in the past two years (including one immediately after 32-year-old Kate Steinle was shot and killed in San Francisco by an illegal immigrant deported five times prior).

At the time, Senate Minority Leader Harry Reid (D-Nev.) derided a sanctuary city ban as "dog-whistle politics," pointing out crimes committed by illegal immigrants aren't any higher than crimes committed by any one else living in America. Senate Democrats gained two seats in November's election, so they should have the numbers to block a ban bill again.

If legislation isn't an option for Trump, some experts think taking the cities to court might be. Jessica Vaughan, the director of policy studies at the conservative-leaning Center for Immigration Studies, says the Trump administration could ask a federal judge for an injunction demanding these sanctuary cities hand over any immigrants the federal government wants to deport. They could argue it's technically against the law to shield immigrants from deportation.

But this, too, comes with risk. Challenging the legality of sanctuary cities has never been tried before, so it's a 50/50 shot on how the courts would read the intersecting and sometimes contradictory laws about state rights and immigration.

Some constitutional scholars argue it could be a 30/70 shot, given a recent Supreme Court Obamacare ruling makes it unconstitutional for the federal government to be a "gun to the head" of state and local governments.

The likeliest route available to Trump to close down sanctuary cities is probably the least effective. The Justice Department, under the leadership of anti-immigration Sen. Jeff Sessions (R-Ala.), could limit law enforcement grants to non-sanctuary cities. Essentially, they'd be making it more expensive to be a sanctuary city, one grant at a time.

Of course, sanctuary cities could just decide sticking it to Trump is worth the cost. Many cities have announced their intention to be sanctuary cities after Trump's threat to cut off funding to them. "I like to compare this to conscientious objector status,” Mayor Libby Schaaf of Oakland, Calif., told the New York Times

And you can't cut off funding for sanctuary cities willy-nilly, argues George Mason Law Professor Ilya Somin, because the Supreme Court has  ruled you can't slap conditions on federal grants without explicitly telling states about the conditions.

Finally, all these options share something that's anathema to conservatives: They're big-government solutions. Getting rid of sanctuary cities requires a state, or Congress, or even the president to take a top-down approach and dictate municipal laws. And that can be an awkward thing for Republicans to gun for.

"The spectacle of the federal government trying to deport large numbers of people in the face of local resistance is unlikely to make good PR for the Trump administration," wrote Somin in The Post's Volokh Conspiracy blog.

Trump has options to try to tamp down on sanctuary cities, but all of them -- legislation, the courts, financial pressure -- are not guaranteed to work. That means some of our biggest cities could openly flout one of Trump's most high-profile campaign promises, and there's not a lot he may be able to do about it.