SAN FRANCISCO (CN) – The Ninth Circuit signed off Thursday on California’s scheme of using gun-sale fees to pay for a system that keeps firearms out of the wrong hands.

Under the Dealer’s Record of Sale system, any customer of a federally licensed gun dealer in California must pay a fee before they can have the gun. The fee has been set at $19 since 2004.

These fees used to cover the cost of prepurchase background checks, but a law passed in 2011 has allowed the state Justice Department to use $5 from every fee collected to fund the Armed Prohibited Persons System. The program cross-references several databases to identify people who are legally prohibited from owning the firearms they once purchased legally.

Barry Bauer and four other individuals joined the National Rifle Association in bringing a federal complaint to stop this practice under the Second Amendment.

Though the challengers argued that the criminal misuse of firearms is not sufficiently related to the legal purchase of firearms to justify the fee, U.S. District Judge Lawrence O’Neill rejected these claims at summary judgment in 2015.

A three-judge panel of the Ninth Circuit affirmed Thursday.

“Where a law poses a minimal burden on core Second Amendment rights in furtherance of an important government interest, the federal courts have universally upheld it,” Chief U.S. Circuit Judge Sidney Thomas wrote for the unanimous panel. “We do the same here. In doing so, we need not — and do not — decide whether the fee implicates the Second Amendment.”

Highlighting a Second Circuit case where the court suggested a $340 fee would not burden Second Amendment rights, Thomas said the challengers offered little evidence to back up their claim that California’s nominal $19 fee poses a serious obstacle to would-be gun owners.

“Although Bauer suggests that a hypothetical $1 million fee could effectively eliminate the general public’s ability to acquire a firearm, that extreme comparison underscores the minimal nature of the burden here,” the 21-page opinion states.

Thomas also upheld California’s fee under the requirement that a regulation must reasonably match a substantial government objective.

Using the fee to improve public safety by targeting illegal gun owners more than meets that burden, especially since there were more than 18,000 such illegal gun owners when the law was passed in 2011, according to the ruling.

The challengers meanwhile made little headway with their point that only a small subset of legal gun buyers will become illegal possessors.

“Essentially everyone targeted by the APPS program was a DROS fee payer at the time he or she acquired a firearm,” Thomas wrote.

U.S. Circuit Judges Ferdinand Fernandez and Mary Murguia rounded out the panel.

The Washington, D.C., firm Bancroft PLLC represented the gun owners with attorneys from the Long Beach firm Michel & Associates.

The gun owners’ attorney C.D. Michel expressed disappointment – but not surprise – with the ruling.

“We are disappointed but not surprised given the Ninth Circuit’s inclination to give the Second Amendment short shrift. Courts – or society – would never tolerate the taxation of people exercising any other right in this manner,” Michel said in an email.

Meanwhile, the California Attorney General’s Office said it was pleased with the panel’s decision.

“We are pleased the court recognized the important public-safety interests advanced by retrieving dangerous firearms from people prohibited from having them. The California Department of Justice will continue to implement the Armed Prohibited Persons System program vigorously.”