The court, as part of the ruling, dismissed charges against a Texas man found guilty of harassing and stalking his girlfriend and also in possession of arms despite a ban.
The decision follows a Supreme Court ruling in June expanding gun rights.
The US justice department is expected to appeal against the order.
Attorney General Merrick Garland said that Congress had determined the law “nearly 30 years ago”.
“Whether analyzed through the lens of the Supreme Court precedent, or of the text, history, and tradition of the Second Amendment, that statute is constitutional,” Mr. Garland said in a written statement. “Accordingly, the Department will seek further review of the Fifth Circuit’s contrary decision.”
In the case of New York State Rifle & Pistol Association v Bruen, the Supreme Court ruled that restrictions against gun owners must be “consistent with this nation’s historical tradition of firearm regulation”.
Although 5th Circuit Judge Cory Wilson said banning people under domestic violence restraining orders from owning firearms was intended to “protect vulnerable people in our society”, he said the Bruen ruling essentially nullified that consideration.
The ban as it applies to this case, Mr. Wilson said, was something that “our ancestors would never have accepted”.
Police in Texas had found guns at the home of Zackey Rahimi who was subject to a civil protective order that banned him from harassing, or threatening his ex-girlfriend and their child. The order also barred him from keeping firearms.
A federal grand jury indicted Mr Rahimi, who pleaded guilty. He later challenged his indictment, arguing that the law that prevented him from owning a gun was unconstitutional.
A federal court ruled against him, saying that it was more important for society to keep guns out of the hands of people accused of domestic violence than it was to protect a person’s individual right to own a gun.
The appeals court withdrew its original decision and on Thursday decided to vacate Mr Rahimi’s conviction.
He had been under a restraining order since February 2020, following the alleged assault of a former girlfriend.
- Attorney: Man involved in train killing shot in self-defense
- As DA Jason Williams awaits federal tax trial, another former lawyer in his firm is charged | Courts
- Vekos would bring defense attorney experience to county prosecutor's job
- Portage double fatal stabbing was self-defense, attorney says at arraignment
- Man accused in La Crosse shooting was acting in self-defense, attorney says | Crime