A federal law that prohibits licensed firearm dealers from selling guns to people under the age of 21 was upheld Thursday in the New Orleans-based 5th U.S. Circuit Court of Appeals.

Individuals between the ages of 18 and 20 can possess handguns, get them as gifts or buy them from private owners, the Wall Street Journal Law Blog notes.

The National Rifle Association filed the lawsuit in 2010. The law in question came about in the late 1960s, and is consistent with a tradition of restricting select groups’ access to gun for public safety, the New Orleans-based 5th Circuit opinion (PDF) found. It’s the first challenge to the age rule following District of Columbia v. Heller, the 2008 U.S. Supreme Court case that found the Second Amendment protects an individual’s right to possess a firearm.

“In the view of at least some members of the founding generation,” the opinion states, “disarming select groups for the sake of public safety was compatible with the right to arms specifically and with the idea of liberty generally.”

David Thompson, who represents the NRA, said his client is considering an appeal.