After studying the issues for weeks and even months, the Supreme Court on Monday sidestepped a slate of controversial issues, including gun control and the debate over “sanctuary cities” for immigrants.

The court passed on a group of gun cases that included restrictions on permits to carry firearms in public places and bans on certain types of weapons — something of a surprise because conservative justices at various times have said just such a review is necessary.

The justices also declined to take up a form of immunity that has shielded police officers from lawsuits alleging excessive force and other civil rights violations. A wide range of academics and civil rights groups on the left and right had called for the court’s intervention, and its most liberal and conservative justices — Sonia Sotomayor and Clarence Thomas, respectively — had expressed interest. The issue of qualified immunity found renewed attention after nationwide protests over the killing of George Floyd last month in police custody.

As usual, the court did not give reasons Monday for denying the cases, so it is only speculation whether it was the issue or the specific cases that the court was rejecting. The justices’ avoidance of such fraught topics, at least for now, allows the court to stay out of the political fray when its next term begins in the heat of the presidential election.

Among the batch of Second Amendment cases the court did not accept were challenges to regulations in Maryland and New Jersey for carrying handguns outside the home. The court earlier this term had dismissed a challenge from New York about transporting guns. Three justices objected, with the newest, Justice Brett M. Kavanaugh, adding that it seemed likely lower courts have been too quick to uphold state and local gun-control measures.

Although he agreed the New York case was moot, Kavanaugh added that he shared the “concern that some federal and state courts may not be properly applying” the Supreme Court’s decision recognizing an individual’s right to gun ownership.

Kavanaugh and Thomas objected again on Monday.

In dissent, Thomas wrote that the New Jersey case presented the ideal opportunity to clarify which regulations are consistent with the individual right the court declared in its landmark 2008 decision in District of Columbia v. Heller. He criticized his colleagues for prolonging “our decade-long failure to protect the Second Amendment” and characterized the New Jersey measure as a near-total prohibition on carrying.

“This court would almost certainly review the constitutionality of a law requiring citizens to establish a justifiable need before exercising their free-speech rights. And it seems highly unlikely that the court would allow a state to enforce a law requiring a woman to provide a justifiable need before seeking an abortion,” Thomas wrote.

“But today, faced with a petition challenging just such a restriction on citizens’ Second Amendment rights, the court simply looks the other way.”

The previous reluctance to reenter the gun-control debate was almost entirely due to retired justice Anthony M. Kennedy. He was part of the court’s 5-to-4 majority in the 2008 decision, which declared a right to gun ownership for personal protection and apart from military service. But Kennedy had also insisted on language that presumed states and localities still had leeway to pass gun restrictions.

Lower courts have pointed to that to uphold many restrictions, and overturn very few.

Kavanaugh’s replacement of his old boss Kennedy was thought to have changed the dynamic on the court. Kavanaugh was skeptical of gun restrictions while a judge on the appeals court, and the National Rifle Association was an enthusiastic backer of his nomination by President Trump. It takes the votes of four justices to review a case.

The New Jersey law requires individuals seeking a permit to carry a handgun in public to show a “justifiable need” based on a special danger. The U.S. Court of Appeals for the 3rd Circuit has deemed the state’s process lawful since 2013. The long-standing regulation “did not infringe on the Second Amendment’s guarantee,” the court said.

The case is Rogers v. Grewal.

Maryland’s law requires applicants for permits to carry handguns outside the home show a “good and substantial” reason. The state says that most who apply are able to make such a showing.

The U.S. Court of Appeals for the 4th Circuit assumed the Second Amendment covered the right to carry a gun in public, but said the state’s system of review by law enforcement and an appeals board balanced the state’s interest in public safety with the rights of gun owners.

The case is Malpasso v. Pallozzi.

Thomas also dissented Monday from the court’s refusal to hear eight separate cases presenting reconsideration of the doctrine of qualified immunity that establishes protection from civil lawsuits for government officials, particularly police officers. Thomas called on his colleagues to revisit the doctrine and expressed “strong doubts” about the court’s past approach.

The doctrine, created by the Supreme Court decades ago, allows civil suits only when it can be shown that an official’s actions violated a “clearly established” statutory or constitutional right. When determining whether the right was clearly established, courts consider whether a reasonable official would have known that the actions were a violation.

In practice, the “clearly established” test often means that for lawsuits to proceed, civil rights plaintiffs must identify a nearly identical violation that has been recognized by the Supreme Court or appellate courts in the same jurisdiction.

Floyd’s death in Minneapolis on May 25 amplified calls for the court — and Congress — to act. Changing qualified immunity is part of the House Democrats’ policing overhaul legislation, and some senators have called for action as well. Trump has opposed those efforts.

“The Supreme Court’s deeply disappointing decision today to punt on the critical issue of official immunity, in this time of national reckoning over police violence, places the ball squarely in Congress’s court,” David Cole, national legal director for the American Civil Liberties Union, said in a statement Monday.

“We have seen the deadly consequences play out on the streets, and black Americans have largely paid the price,” he added.

The court’s qualified-immunity decisions have for years raised concerns among lawyers and academics. Legal scholars have criticized the court for what they say is a rewrite of an important civil rights law meant to ensure that federal courts provide protection to all Americans.

The law, now known as Section 1983 of the U.S. Code, imposes liability on officials who use their positions to deprive anyone of “any rights, privileges or immunities secured by the Constitution.”

There is no exception in the law for police. But beginning in the 1980s, the Supreme Court began providing some immunity for officials, saying that the rights violation must be “clearly established” for a lawsuit to proceed.

This was intended to provide some “breathing room” for police in tense situations making decisions in the moment, the court said.

But Sotomayor, who did not sign on to Thomas’s dissent Monday, has frequently dissented when her colleagues have granted or upheld qualified immunity in excessive force cases, and said the doctrine has grown from protecting officials from harassing lawsuits into “an absolute shield for law enforcement officers.”

The court also let stand 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 law passed after Trump took office and was 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 Thomas indicated they would have heard the administration’s appeal.

Solicitor General Noel Francisco had asked the 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 simply has 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 case is U.S. v. California.