In a stunning and unexpected ruling, the U.S. District Court of the District of Columbia struck down the city’s ban on carrying handguns in public on Saturday.

According to the judge who decided the case, the District’s ban violates Second Amendment rights.

This ruling is not only a win for residents of the nation’s capital who can now legally carry a handgun outside of their homes, but for those from neighboring states and visitors from across the country, who have unwittingly broken the law by bringing their legal firearms into the city.

Surprised city officials are scrambling to figure out what to do next but plan to seek a stay of the judge’s order.

The ABC news affiliate WJLA reports:

In a decision made public late Saturday, Scullin concluded that the Second Amendment gives people the right to carry a gun outside the home for self-defense. He cited two U.S. Supreme Court cases as important to his ruling – the 2008 opinion striking down the District of Columbia's ban and a 2010 ruling involving Chicago's handgun ban.

"There is no longer any basis on which this court can conclude that the District of Columbia's total ban on the public carrying of ready-to-use handguns outside the home is constitutional under any level of scrutiny," wrote Scullin, who was appointed by President George H.W. Bush and is a retired Army colonel.

The city rewrote its rules after the 2008 Supreme Court decision. Residents were required to register their guns and keep them in their homes. Gun owners also have to take a safety class, be photographed and fingerprinted and re-register their weapons every three years. Those requirements were challenged in court but upheld by a federal judge in May.

Gun rights advocates are celebrating what has been a contentious fight to allow Americans to exercise their constitutional rights here in Washington.

The lawsuit was filed in 2009 by the Second Amendment Foundation, a Washington state-based organization, on behalf of three D.C. residents and a New Hampshire resident who said they wanted to carry guns for protection but were denied permits by the city.

Hand guns are not just constitutional issue but a measure for protection in a city that has transitioned in from being a (violent) crime-ridden and blighted hotspot in the 1980s and early 1990s to a popular destination for affluent and ambitious young people.  Although crime rates have dropped to their lowest levels, there are pockets of concentrated poverty and violent crime in the city. In addition, in gentrified and revitalized neighborhoods with vibrant nightlife, crime remains a problem.

From sexual assaults and rapes on young women walking home to robberies of iPhones and break-ins, D.C. residents have suffered in silence without the right to arm themselves outside of their homes or businesses. At least for now, that right is restored.

This issue is far from done. City officials argue that Washington, D.C., is unique from any other city or place in the country and that any rights to carry should be strictly regulated. We'll keep watching this story unfold.