The Supreme Court on Thursday dismissed a number of cases testing the Trump administration’s plan to withhold law-enforcement grants from cities that refused to cooperate with Department of Homeland Security efforts to deport noncitizens arrested by local police.

The court, which hadn’t yet decided whether it would hear the cases, acted shortly after the Biden administration and state and city governments in New York and California jointly asked the justices to dismiss the pending appeals.

Lower courts in New York and San Francisco had reached varying conclusions on the Justice Department’s authority to withhold funds that Congress had authorized to assist local police departments.

JUSTICE AMY CONEY BARRETT ISSUES FIRST SUPREME COURT OPINION

"We’re glad this issue has finally been put to rest," said San Francisco City Attorney Dennis Herrera. "Federal officials can do their job in San Francisco, just like anywhere else in the country. But we were not about to let our police, firefighters and nurses be commandeered and turned into the Trump administration’s deportation force."

About $1.4 million annually in federal funds was at stake for San Francisco, the city attorney’s office said.

"Local law enforcements’ ability to protect their jurisdictions should never be compromised to push an anti-immigrant agenda," said New York state Attorney General Letitia James. "We look forward to continuing to work with the administration to ensure state and localities never have to choose between protecting their autonomy and protecting the public’s safety."

The Justice Department declined to comment.

GOP MAPS OUT STRATEGY TO COUNTER BIDEN'S 'IMMORAL,' 'RADICAL' IMMIGRATION AGENDA

The legal challenges arose at various times since 2017, when the Trump administration said it would withhold Justice Assistance Grants from local governments that refused to comply with three new conditions. Those include informing immigration agents upon request of the scheduled release of any person in custody "believed to be an alien," allowing immigration officials access to local jails and sharing immigration status information with federal authorities.

The move targeted cities such as New York and San Francisco that have adopted so-called sanctuary policies, which limit cooperation with immigration authorities. Local officials say such policies improve public safety by increasing trust between immigrant communities and the police. The Trump administration said the cities were tolerating the presence of noncitizens who had committed crimes and posed a danger to the public.