“This is just the first case but not likely the last case where at least four justices open the way to a major ruling that could limit gun safety laws,” said Michael Waldman, the author of “The Second Amendment: A Biography,” referring to a Supreme Court rule requiring four votes to add cases to its docket.

The New York City ordinance challenged in the new case allows residents with so-called premises licenses to take their guns to one of seven shooting ranges within the city limits. But the ordinance forbids them to take their guns anywhere else, including second homes and shooting ranges outside the city, even when they are unloaded and locked in a container separate from ammunition.

The Supreme Court’s new majority seems ready to continue a project begun in 2008, when the court, by a 5-to-4 vote, established an individual right to keep guns in the home for self-defense. That decision, District of Columbia v. Heller, was both revolutionary and in its way quite limited. Exactly what the Second Amendment protects has been in dispute ever since.

Justice Antonin Scalia’s majority opinion in the Heller decision included an important limiting passage that was almost certainly the price of Justice Kennedy’s fifth vote. “Nothing in our opinion,” Justice Scalia wrote, “should be taken to cast doubt on longstanding prohibitions on the possession of firearms by felons and the mentally ill, or laws forbidding the carrying of firearms in sensitive places such as schools and government buildings, or laws imposing conditions and qualifications on the commercial sale of arms.”

Since the Heller decision, lower courts have overwhelmingly upheld state and local gun control laws. The Supreme Court, in turn, has refused to hear appeals from those decisions. Justice Kavanaugh’s arrival changed that.