The 5-4 ruling could ultimately make it easier for individuals to own handguns.
Splitting along conservative and liberal lines, the nation's highest court extended its landmark 2008 ruling that individual Americans have a constitutional right to own guns to all cities and states for the first time.
The decision was a setback for Chicago's 28-year-old ban on handguns, which will now face a fresh judicial review and is likely to be eventually overturned. Legal challenges to existing laws restricting gun use in other states and cities are also expected.
The right to bear arms, enshrined under the Second Amendment of the US Constitution, previously applied to just federal laws and federal enclaves, including Washington DC, where the court struck down a similar handgun ban in its 2008 ruling.
Gun rights has been one of the country's most divisive social, political and legal issues. Some 90 million people in the United States have an estimated 200 million guns.
The ruling, issued on the last day of the Supreme Court's term, was a victory for four Chicago-area residents, two gun rights groups and the politically powerful National Rifle Association.
But the move was a defeat for Chicago, which defended its law as a reasonable exercise of local power to protect public safety. The law, and a similar handgun ban in Oak Park, Illinois, were the nation's most restrictive gun control measures.
"We hold that the Second Amendment right is fully applicable to the states," Justice Samuel Alito concluded for the court majority.
However, the justices did not strike down the Chicago law directly, but sent the case back to a US appeals court for review.