A federal judge ruled Tuesday that a section of Chicago's gun ordinance that bans residents convicted of using a firearm illegally from obtaining a permit is unconstitutional.

U.S. District Judge Samuel Der-Yeghiayan issued the ruling in favor of Chicagoan Shawn Gowder, who filed a lawsuit backed by the National Rifle Association after he was denied a weapons permit over a misdemeanor unlawful use of a weapon conviction, according to CBS Chicago.

In the suit, Gowder argued that the city's language was too vague, barring permits from being issued to anyone with an unlawful weapon use charge without distinguishing between violent crime convictions and non-violent possession charges.

Gowder already has an Illinois Firearm Owner's Identification Card, but was denied a special permit required in Chicago as part of the city's gun ordinance, NBC Chicago reports.

"There is something incongruent about a nonviolent person, who is not a felon but who is convicted of a misdemeanor offense of simple possession of a firearm, being forever barred from exercising his constitutional right to defend himself in his own home in Chicago against felons or violent criminals," Der-Yeghiayan wrote in his opinion, according to the Chicago Tribune.

Chicago enacted a special ordinance in 2010 allowing residents to possess weapons in their homes, but requiring special city permits after the Supreme Court struck down the city's handgun ban as unconstitutional.

The Chicago Sun-Times reports that the city urged Judge Der-Yeghiayan to protect the ordinance and rule against Gowder, arguing that issuing permits to residents already convicted of misdemeanor weapons crimes could lead to more problems in a city already plagued by gun violence.

The letter from the city cites statistics suggesting that handgun purchasers with at least one conviction have a 7.5 times higher risk for re-offending, according to the newspaper.

But Der-Yeghiayan's 30-page ruling called the permit ban "indiscriminate and arbitrary governmental regulation" and shut it down, according to USA Today.