U.S. Attorney General Jeff Sessions announced Monday that any move to withhold federal funding to “sanctuary cities” would be limited to federal grants controlled by the Justice and Homeland Security departments.

But, in a memo, the attorney general made clear that cities that do not cooperate with federal immigration officials will risk that funding.

The memo comes after a federal judge in California issued a temporary injunction last month, blocking enforcement of an executive order from President Trump—issued five days into office-- that sought to deny federal money for sanctuary jurisdictions.

The Justice Department, in court filings and meetings with state officials, has sought to minimize the impact and scope of the order. Sessions has encouraged states and cities to voluntarily cooperate, calling it a matter of public safety, by honoring so-called “detainer” requests to turn over certain suspected illegal aliens to federal law enforcement.

In the memorandum, Sessions said “the Department of Justice will require jurisdictions applying for certain Department grants to certify their compliance with federal law.” But enforcement of any cities that limit cooperation with federal authorities over certain immigration matters “will be applied solely to federal grants administered by the Department of Justice or the Department of Homeland Security, and not to other sources of federal funding.”

At issue in the ongoing legal fight is the definition of “sanctuary city” and which localities would be subject to sanction, as well as the extent to which Sessions has the authority to designate sanctuary jurisdictions.

Sessions noted immigration enforcement remains a top administration priority, especially the section of federal law known as 8 USC 1373, which says local communities may not interfere in communications with federal authorities regarding an individuals’ immigration status.

Last month, the Justice Department sent letters to nine jurisdictions ordering them to prove compliance with Section 1373 before June 30 or risk losing certain grants for the current fiscal year.

The attorney general said his department would continue using its authority and flexibility when denying any federal money to sanctuary cities. “Going forward, the Department, when authorized, may seek to tailor grants to promote a lawful system of immigration,” Sessions said in his Monday memo.