(Reuters) - The National Rifle Association failed to persuade a federal appeals court to overturn a California law requiring that $5 of a $19 fee imposed on firearms transfers be used to fund enforcement efforts against illegal firearm purchases.

In a 3-0 decision on Thursday, the 9th U.S. Circuit Court of Appeals in San Francisco said the law advanced California’s interest in disarming people who are forbidden from possessing guns and rifles, while imposing only a “minimal” burden on core constitutional rights under the Second Amendment.

California’s prohibition covers people convicted of felonies or violent misdemeanors, people subject to domestic violence restraining orders, and the mentally ill.

“The government has demonstrated an important public safety interest in this statutory scheme, and there is a reasonable fit between the government’s interest and the means it has chosen to achieve those ends,” Chief Judge Sidney Thomas wrote.

Thursday’s decision is a defeat for the NRA, the California Rifle and Pistol Association Foundation and four other plaintiffs.

They argued that by taxing legal firearm transfers to combat wrongful firearm possession, California imposed an “unconstitutional tax on a fundamental right.”

According to court papers, the remaining $14 of each fee goes toward running background checks and processing paperwork.

An NRA spokeswoman had no immediate comment. A lawyer who argued its appeal did not immediately respond to requests for comment.

The office of California Attorney General Xavier Becerra, which defended the state law, had no immediate comment.

Thursday’s decision upheld a March 2015 ruling by Chief Judge Lawrence O’Neill of the U.S. District Court for the Eastern District of California. He sits in Fresno.

The case is Bauer et al v. Becerra et al, 9th U.S. Circuit Court of Appeals, No. 15-15428.