Four former prison guards who were barred from carrying concealed guns despite a 2004 federal law that gave off-duty and retired law enforcement officers the right to pack heat won a landmark court victory on Thursday.

In a 2-1 decision, the U.S. Court of Appeals for the Washington D.C. Circuit held that the city’s Department of Corrections improperly barred the men from carrying concealed firearms, saying the 2004 Law Enforcement Officers Safety Act guaranteed their right. The court rejected the city’s argument that the law does not apply to corrections officers because they lack arresting authority.

“[Congress] left no discretion for a state to revise the historical record of an individual qualified law enforcement officer,” read the majority opinion.

The law was intended to improve response to threats in public as well as to allow current and former law enforcement officers with at least 10 years’ experience the ability to protect themselves from criminals they may have had past dealings with. Although plaintiffs Robert Smith, Ronald DuBerry, Harold Bennette and Maurice Curtis all said they regularly received threats from inmates they once guarded, their applications for concealed-carry licenses were denied.

“I will not certify an application request for carrying a concealed weapon under LEOSA for retired employees, as corrections officers do not meet all of the required elements necessary.” Corrections Department Director Tom Faust said at the time.

It is not clear whether the decision will be appealed, but it makes clear for now that the Law Enforcement Officers Safety Act must extend to retired and off-duty corrections officers as well as state and local police and federal agents.

Smith, who retired as a Corrections department firearms instructor, told the The Washington Times in 2014 that he was fired upon by men he suspects were former inmates as he took out the trash outside his home.

“They remember you,” he said.

The District of Columbia’s fight to leave former corrections officers unarmed shows how entrenched its opposition to guns is, according to John Lott, president of the Crime Prevention Research Center.

“This case illustrates how extreme the District of Columbia’s opposition to concealed carry has been,” Lott said. “Here you have law enforcement who are offering to protect others for free, and the District has borne large legal costs to stop them from doing it.”

In a dissenting opinion, Judge Karen Henderson wrote that the federal law did not preclude state or local officials from determining who met the qualifications under the act.

“It makes perfect sense to likewise conclude that the Congress intended a state court to determine whether one of its retired law enforcement officers is “qualified,” that is, whether he possessed certain state law authority.”