The Supreme Court on Monday declined to take up California’s “sanctuary” law that forbids local law enforcement in most cases from cooperating with aggressive federal action to identify and deport undocumented immigrants.

The court let stand the law passed after President Trump took office and challenged by his administration. The most significant measure limits police from sharing information unless the immigrants have been convicted of violent or serious crimes.

Justices Samuel A. Alito Jr. and Clarence Thomas indicated they would have heard the administration’s appeal.

Solicitor General Noel Francisco had asked the Supreme Court to take the case, saying the law intrudes on what is a federal responsibility.

“The federal government has exclusive authority over the presence of aliens in the United States, including ‘which aliens may be removed from the United States and the procedures for doing so,’ ” Francisco told the court in a brief. He was quoting from a 2012 Supreme Court opinion in which the court struck down an Arizona law that attempted to give police a greater role in detaining immigrants.

What was good for Arizona must also be right for California, he wrote.

California responded that it is not hampering federal authority, it has simply chosen not to volunteer for service.

The law is “consistent with the longstanding principle that the Constitution allows states to decline to use their own resources to carry out federal regulatory programs,” state Attorney General Xavier Becerra said in his brief to the court.

Becerra said the state legislature decided it would make local law enforcement’s job building trust in immigrant communities and solving crimes more difficult if police were seen as immigration enforcement agents.

The most significant restraint is on informing federal agents when most immigrants are being released from custody.

A panel of the U.S. Court of Appeals for the 9th Circuit agreed with a district judge who said the choice was California’s to make.

“The laws make enforcement more burdensome than it would be if state and local law enforcement provided immigration officers with their assistance,” wrote U.S. District Judge John Mendez. “But refusing to help is not the same as impeding. If such were the rule, obstacle preemption could be used to commandeer state resources and subvert Tenth Amendment principles.”

The case is U.S. v. California.