The Supreme Court on Thursday struck down a restrictive New York gun law in a major ruling for gun rights.

The justices’ 6-3 decision is expected to ultimately allow more people to legally carry guns on the streets of the nation’s largest cities — including New York, Los Angeles and Boston — and elsewhere. About a quarter of the U.S. population lives in states expected to be affected by the ruling, the high court’s first major gun decision in more than a decade.

The ruling comes as Congress is actively working on gun legislation following recent mass shootings in Texas, New York and California.

Justice Clarence Thomas wrote for the majority that the Constitution protects “an individual’s right to carry a handgun for self-defense outside the home.”

In their decision, the justices struck down a New York law requiring people to demonstrate a particular need for carrying a gun in order to get a license to carry one in public. The justices said the requirement violates the Second Amendment right to “keep and bear arms.”

California, Hawaii, Maryland, Massachusetts, New Jersey and Rhode Island all have similar laws likely to be challenged as a result of the ruling. The Biden administration had urged the justices to uphold New York’s law.

Backers of New York’s law had argued that striking it down would ultimately lead to more guns on the streets and higher rates of violent crime. The decision comes at a time when gun violence already on the rise during the coronavirus pandemic has spiked anew.

In most of the country gun owners have little difficulty legally carrying their weapons in public. But that had been harder to do in New York and the handful of states with similar laws. New York’s law, which has been in place since 1913, says that to carry a concealed handgun in public, a person applying for a license has to show “proper cause,” a specific need to carry the weapon.

The state issues unrestricted licenses where a person can carry their gun anywhere and restricted licenses that allow a person to carry the weapon but just for specific purposes such as hunting and target shooting or to and from their place of business.

The Supreme Court last issued a major gun decision in 2010. In that decision and a ruling from 2008 the justices established a nationwide right to keep a gun at home for self-defense. The question for the court this time was about carrying one outside the home.

The court has previously indicated there is no problem with restrictions on carrying guns in “sensitive places” including government buildings and schools. It has said the same about restricting felons and the mentally ill from carrying guns.

The challenge to the New York law was brought by the New York State Rifle & Pistol Association, which describes itself as the nation’s oldest firearms advocacy organization, and two men seeking an unrestricted ability to carry guns outside their homes.

The court’s decision is somewhat out of step with public opinion. About half of voters in the 2020 presidential election said gun laws in the U.S. should be made more strict, according to AP VoteCast, an expansive survey of the electorate. An additional third said laws should be kept as they are, while only about 1 in 10 said gun laws should be less strict.

About 8 in 10 Democratic voters said gun laws should be made more strict, VoteCast showed. Among Republican voters, roughly half said laws should be kept as they are, while the remaining half closely divided between more and less strict.