Los Angeles (CNN) Democratic mayors of the nation's largest cities are quickly banding together to fight President Donald Trump's crack down on so-called sanctuary cities.

Trump signed an executive order Wednesday that White House press secretary Sean Spicer said will "strip federal grant money from the sanctuary states and cities that harbor illegal immigrants." The President reiterated his desire to target such cities Thursday when he spoke to a congressional Republican retreat.

But mayors in cities including Los Angeles, Boston and New York, as well as legal scholars, are saying not so fast. They're confident their status as sanctuary cities -- jurisdictions that have policies in place designed to limit cooperation with or involvement in federal immigration enforcement actions -- is secure.

Some are pointing to Supreme Court cases that have made it difficult for Washington to punitively withdraw money from state and local governments.

"We feel very strongly that the legal case is clear," Los Angeles Mayor Eric Garcetti told reporters after the executive order was announced.

He alluded to NFIB vs. Sebelius, a 2012 case that challenged aspects of former President Barack Obama's health care law. In one part of that decision, seven justices including Chief Justice John Roberts, agreed the Medicaid expansion provision under the ACA violated the Constitution by threatening to take away states' Medicaid money if they refused to comply with the expansion.

'Loud and clear'

"Back then it was a different politics, maybe it's ideologically reversed, but it was loud and clear," Garcetti said. "You can take away funding from a specific program if you don't adhere to the requirements of that program, but we don't have funding that is for the co-cooperation of our immigration federal officials and our local officials."

Ultimately, Garcetti said it's not up to his local police department to enforce federal immigration laws.

"They don't do immigration law any more than they do postal fraud or tax evasion," Garcetti said. "That is the responsibility of the federal government."

Karen Tumlin, legal director for the National Immigrant Law Center, said there is a long line of cases that deal with the spending clause of the US Constitution. They have underscored, she said, that the federal government can put some requirements on states when they parcel out funding, "but it can't be unduly coercive."

The need for a clear correlation between an action by a state and a threat to pull federal funding, was affirmed in the 1987 case South Dakota vs. Dole. That case looked at states that wanted to have a drinking age under 21. The federal government threatened to restrict highway funding in those states because they believed the underage drinking laws affected highway safety.

In that case, the court ruled that the federal government wasn't being "unduly coercive" because underage drinking was indeed directly related to highway safety.

"There is a constitutional boundary there," Tumlin said, "and the boundary really is coercion -- this notion of sanctity between what kinds of things localities get to decide and when the federal government can coerce them into action."

One of the many complex facets of how Trump's executive order will play out is the fact that the term "sanctuary city" has no universal meaning.

Police chiefs around the country have widely varying policies in the degree to which they cooperate with ICE agents and the lengths they will go to protect undocumented immigrants.

Law enforcement leaders in some cities have argued it is invaluable to have a strong relationship with immigrant communities -- and limit fear of deportation -- when they are trying to solve crimes. Undocumented immigrants, they note, can serve as helpful informants.

Tricky balance for mayors

But Democratic mayors face a tricky balance.

Many of them want to develop a good relationship with the Trump administration, because they see opportunities to bring dollars to their cities if the new President embarks on the major infrastructure projects he has promised. Garcetti, for example, has spoken to Trump three times since he was elected about projects that they could collaborate on.

But in the most liberal bastions of the country, mayors must also answer to their constituents who want to see path to citizenship for as many as 11 million immigrants living in the United States.

Boston Mayor Marty Walsh was among the most strident voices in the resistance this week -- promising that if necessary, he would "use City Hall itself to shelter and protect anyone who is targeted unjustly."

"We will not be intimidated by the threat to federal funding," Walsh said. "We have each other's backs, and we have the Constitution of the United States of America on our side."

New York City Mayor Bill de Blasio declared Trump's executive order to be "vague and in some ways contradictory" and "very susceptible to legal challenge."

"If they make an attempt to pull that money, it will be from NYPD, from security funding to fight terrorism," de Blasio told CNN's Alisyn Camerota Thursday on "New Day ." "If an attempt is made to do that, we will go to court immediately for an injunction to stop it."

In Chicago, Mayor Rahm Emanuel, who has welcomed Trump's Twitter offer to send in federal resources to reduce Chicago's shooting and killings, told reporters that the executive order wouldn't change anything.

"We are going to stay a sanctuary city," he said during a press conference.

Noting the executive order lacked any detail about what funds would be taken away, he decided to highlight the positive.

"I'm going to take the President's offer to give us resources, and that's where I'm going to focus," Emanuel said.