Image caption Some cities like Chicago have strict firearms rules

The US Supreme Court has restricted the rights of state and city governments to enforce controls on gun ownership.

The US's highest court ruled by 5-4 that a ban on handgun ownership in the city of Chicago was unconstitutional.

Justices said the US Constitution protected the right to keep and bear arms for the purpose of self-defence.

The ruling could potentially change laws on gun ownership in many of the 50 US states.

A well regulated Militia, being necessary to the security of a free State, the right of the people to keep and bear Arms, shall not be infringed Second Amendment, As passed by Congress Supreme Court ruling Q&A: Supreme Court decision

Debate over the exact meaning of the constitutional right to keep and bear arms has raged for years in the US.

The amendment reads: "A well regulated Militia, being necessary to the security of a free State, the right of the people to keep and bear Arms shall not be infringed."

Two years ago, the court ruled a ban on handguns in Washington DC was unconstitutional - declaring that the Second Amendment protects an individual's right to possess guns, at least for purposes of self-defence in the home.

But Washington is a federal city, with a unique legal standing.

Gun rights proponents almost immediately filed a federal lawsuit challenging gun control laws in Chicago, Illinois, and its suburb of Oak Park, where handguns have been banned for nearly 30 years.

Analysis A defining moment in the history of gun ownership in America? Or a symbolic ruling with limited practical consequences? As always, when it comes to guns and the law, it depends on where you stand. In one sense, the Supreme Court's ruling is quite narrow. It upholds the right of individuals to keep handguns at home for the purposes of self-protection. The ruling makes it clear that this does not mean that all laws governing gun ownership in America are now in doubt. But for the first time, the US Supreme Court has offered a clear definition of national significance of 27 much debated words written in 1789. Supporters of gun ownership, who've long argued that this strangely worded and punctuated statement means that individuals should be allowed to carry guns, have hailed today's ruling as a victory. The Supreme Court signalled its intentions two years ago, when it struck down a handgun ban in the District of Columbia. Coming on the very day that confirmation hearings began for a moderate replacement for a retiring liberal justice, its latest gun control ruling serves as a reminder that the current Supreme Court is one in which conservatives hold sway.

In Monday's ruling on that challenge the justices said the Second Amendment right "applies equally to the federal government and the states".

Correspondents say the ruling will be seen as a blow to efforts to reduce the role of firearms in American life.

The justices seen as the more liberal - Stevens, Breyer, Ginsburg and Sotomayor - voted against the latest ruling.

The case was brought by four Chicago residents as well as local firearms rights activists and the National Rifle Association.

The latest Supreme Court decision does not explicitly strike down the Chicago area laws, but it orders a federal appeals court to reconsider its ruling - leaving little doubt that the laws will eventually be overturned.

The NRA welcomed the "landmark decision" of the court.

"The NRA will work to ensure this constitutional victory is not transformed into a practical defeat by activist judges, defiant city councils or cynical politicians who seek to pervert, reverse or nullify the Supreme Court's McDonald decision," said NRA executive vice-president Wayne LaPierre.

New York Mayor Michael Bloomberg, an ardent proponent of gun control, said the ruling allows cities "to keep guns out of the hands of criminals and terrorists while at the same time respecting the constitutional rights of law-abiding citizens".

The Supreme Court's decision follows a weekend in which 29 people in Chicago were shot, three of them fatally, according to local media.

The Chicago Sun-Times reported that 54 people were shot, 10 of whom died, the previous weekend as well.