SAN FRANCISCO (Reuters) - The U.S. Justice Department on Monday asked a federal judge to reconsider a ruling which blocked President Donald Trump’s attempt to cut off federal funding for so-called sanctuary cities, citing a new memo from the attorney general.

U.S. District Judge William Orrick III in San Francisco last month said Trump’s order targeted broad categories of federal funding for sanctuary governments and that plaintiffs challenging the order were likely to succeed in proving it unconstitutional.

The Republican president’s moves on immigration have galvanized legal advocacy groups, along with Democratic city and state governments, to oppose them in court. The administration suffered an earlier defeat when two federal judges suspended executive orders restricting travel from several Muslim-majority countries. The government has appealed those decisions.

The new filing comes in the wake of a memo released on Monday in which Attorney General Jeff Sessions formally endorsed a narrower interpretation of Trump’s order, saying that the only funds the government intended to withhold were certain grants tied to law enforcement programs.

“The authoritative position set forth in the AG memorandum squarely contradicts the court’s determination,” DOJ lawyers wrote.

In Orrick’s original ruling against the Trump order, he cited comments by the president and Sessions which suggested the government intended to target a much wider swath of federal funds.

Sanctuary cities generally offer safe harbor to illegal immigrants and often do not use municipal funds or resources to advance the enforcement of federal immigration laws. Dozens of local governments and cities, including New York, Los Angeles and Chicago, have joined the growing “sanctuary” movement.

Supporters of the sanctuary policy argue that enlisting police cooperation in rounding up immigrants for removal undermines communities’ trust in local police, particularly among Latinos.

The Trump administration contends that local authorities endanger public safety when they decline to hand over for deportation illegal immigrants arrested for crimes.

Santa Clara County, which includes the city of San Jose and several smaller Silicon Valley communities, sued in February, saying Trump’s order was unconstitutional. San Francisco filed a similar lawsuit.