A federal judge ruled Tuesday that the Trump administration cannot strip money from New York and other so-called sanctuary cities for sheltering undocumented immigrants. NY1's Josh Robin filed the following report.

It was one of President Donald Trump's first executive orders. Federal grants to cities like New York would now be off limits, except in a limited cases.

But under Tuesday's court decision, Trump's order is off limits, everywhere.

Though San Francisco and a nearby county brought the suit, federal Judge William Orrick dismissed a bid from Trump's lawyers to limit its reach.

"The Government argues that, if an injunction is issued, it should be issued only with regards to the plaintiffs and should not apply nationwide. But where a law is unconstitutional on its face, and not simply in its application to certain plaintiffs, a nationwide injunction is appropriate," the decision reads.

"We're delighted by the news from the West Coast," said Nisha Agarwal, commissioner of New York City's Mayor's Office of Immigrant Affairs.

"The mayor's been very clear that the executive order on sanctuary cities was very vague, that it overbroad and that it was overreach by the federal government. And now we have a federal court standing up and saying the same thing," Agarwal said.

Tuesday's decision stresses the fact that Trump is having trouble translating his campaign promises on immigration into laws that stick. A Hawaii court is blocking a ban on travel from certain nations, a ban the White House rewrote after a Seattle judge blocked it.

Amid protests against Trump's order, his supporters say the Republican should continue to appeal. 

"And they should be out of here. And the people across this great nation want them out of here," said state Senator Martin Golden, a Republican from Brooklyn. "So you're going to see this expedited, I believe to the Supreme Court and get us a Supreme Court hearings, and the judges, we hope, will do the right thing and stop cities from sanctuaries for these murderers."

The Justice Department says in a statement that the order confirmed its ability to require sanctuary cities to comply with federal law. It declined to comment on whether it would appeal.

Meanwhile, the president is announcing his first trip back to New York since his inauguration. On May 4, he will speak aboard the Intrepid, commemorating a World War II battle that joined U.S. and Australian forces. The Australian prime minister will join Trump in New York.