Supporters of gun rights in the US won a major legal victory today, when the highest court in the country ruled that an individual's constitutional right to bear arms applied to every corner of the country and throughout its 50 states.

The US supreme court delivered a split judgment along the familiar 5-4 conservative-liberal divide. The ruling specifically overturned a ban on handguns in Chicago that has stood for 28 years.

Its general finding – that all states must comply with the second amendment to the constitution – is likely to have a sweeping impact on local gun laws, particularly in inner-city areas.

The judgment was greeted with joy by the National Rifle Association, the leading proponent of gun rights in a country that has the highest prevalence of civilian gun ownership in the world. The NRA's Wayne LaPierre called it "a great moment in American history".

But in a statement, the Violence Policy Center said: "People will die because of this decision. The gun lobby and gunmakers are seeking nothing less than the complete dismantling of our nation's gun laws." The centre estimates that 30,000 people die in the US every year through gun violence.

The supreme court was called upon to consider the consequences of its own ruling a year ago in which it struck down, by the same 5-4 margin, the ban on handguns in Washington DC. That was the first time the court had ever delivered a major judgment on gun rights. Washington is a district and not a state, so that ruling had no bearing on the rest of the US. This week's case, McDonald v Chicago, was designed to reach a conclusion about the wider picture.

In their majority opinion, the five conservative supreme court judges, led by Justice Samuel Alito, said that the Chicago handgun ban was unconstitutional because it breached the right of the individual to own guns in his or her own home. "Self-defence is a basic right, recognised by many legal systems from ancient times to the present, and individual self-defence is the central component of the Second Amendment", the opinion says.

Alito was backed by John Roberts, Anthony Kennedy, Antonin Scalia and Clarence Thomas. But the four liberal judges — Stephen Breyer, Ruth Bader Ginsburg, Sonia Sotomayor and John Paul Stevens — disagreed. In his dissenting judgment, Breyer said there was no consensus over a fundamental right to self-defence. "The historical evidence is, at most, ambiguous."

John Bruce, an expert on gun control policy at the University of Mississippi, described the ruling as a "big deal". He said: This ruling snuck up on people when they were distracted by other events."

Bruce predicted there would now be a flurry of legal challenges, as the gun lobby tried to use the supreme court ruling as a green light to push back controls in states across the country.

The first area affected is Chicago, which must now allow the sale of handguns to lawful owners. It had argued before the court that it had a duty to keep its citizens safe from an ongoing epidemic of gun violence. In the first five months of this year, 164 people in Chicago were murdered with guns, a rise of 4% on the same period in 2009. Over a single weekend this month, 10 people were killed and 60 wounded.

Other big cities that have introduced tough restrictions on gun ownership, such as New York, are also likely to face challenges. Daniel Vice, a lawyer at the Brady Center to Prevent Gun Violence, said the gun lobby and criminals would now be emboldened to try to push back local laws. But he thought that in the overwhelming number of cases, those challenges would be rejected by the courts.

"Cities will still be allowed to regulate the type of guns that can be bought and to keep them out of the possession of dangerous people," he said.