Federal background checks for long gun sales in California surged to an 18-year high in November, according to the FBI’s database.

Dealers processed 82,554 applications for long guns through the National Instant Criminal Background Check system last month, a 57 percent increase over November 2015 and a 34 percent jump from October.

Why? The bullet button ban, says Sam Paredes, executive director of Gun Owners of California.

California Gov. Jerry Brown signed a bill July 1 outlawing guns outfitted with bullet buttons — a magazine quick-release mechanism operated with a small tool — as part of a package of legislation drafted in response to the San Bernardino mass shooting.

Federal investigators told the Los Angeles Times two of the five weapons recovered at the scene where suspects Syed Rizwan Farook and Tashfeen Malik allegedly killed 14 people and injured 21 others were equipped with the devices.

Gun control advocates argue closing the bullet button loophole in California’s assault weapons ban could prevent future mass casualties.

The National Rifle Association lambasted state lawmakers for exploiting a terrorist attack in order to pass “draconian” laws that make gun owners “second class citizens.”

“My goal in signing these bills is to enhance public safety by tightening our existing laws in a responsible and focused manner, while protecting the rights of law-abiding gun owners,” Brown said in a July signing message.

The bill spawned a summer spike in long gun sales, with July and August ranking as the most active months this year in California for NICS checks.

Federal data for November, however, shows long gun checks eclipsed the summer surge by more than 40 percent.

Paredes says come January, not only will California no longer allow the sale of bullet button-equipped rifles, but it will mandate current owners to either register their firearms, sell the weapons across state lines, turn bullet button long guns over to law enforcement or destroy the guns completely.

Owners could also disassemble the weapons into “a conforming condition,” he said. “Folks are rightfully concerned because as of Jan.1, 2017, sales of those guns will be banned.”

It’s been a big year for NICS nationwide, a known proxy for gun sales, with last month’s tally of 2,561,281 applications processed through the system officially making 2016 the biggest year ever for background checks.

The FBI says NICS set a new Black Friday record, too, of 185,713 applications, outpacing last year’s background checks by nearly 400.

The Black Friday boon follows weeks of media scrutiny over plummeting gun stocks and a potentially hampered holiday selling season — historically the gun industry’s most profitable.