A pair of federal judges on Friday separately blocked President Donald Trump’s administration from unilaterally imposing new conditions on hundreds of millions in US Department of Homeland Security grants to cities including San Francisco, Los Angeles and New York.

US District Judge William Orrick in San Jose temporarily blocked President Donald Trump’s administration from unilaterally imposing new conditions on over $350 million in US Department of Homeland Security grants to more than two dozen cities and counties in California, Washington and Arizona.

In Chicago, US District Judge Manish Shah also entered an order temporarily blocking the new conditions on more than $100 million in DHS grants to New York, Boston and several other cities.

Both judges said the Trump administration likely violated the law when it issued executive orders that sought to cut off DHS funding to local governments unless they ended programs that support diversity, equity and inclusion and complied with the president’s other executive orders. Orrick additionally barred conditions that required local governments to support federal immigration enforcement and stop providing benefits to immigrants who are in the country illegally.