A federal lawsuit challenging the use of background check data on firearms sales in the Federal Bureau of Investigation’s terror database since 2004 argues the practice is illegal.

The lawsuit, now in the U.S. 2nd Circuit, alleges that the government abused its access to information given by potential gun buyers to conduct background checks by comparing it to the terrorist screening database. In sum, that the FBI’s Terrorist Screening Center has no legal right to access the personal information on the Bureau of Alcohol, Tobacco, Firearms, and Explosives’ gun transfer forms.

For over a decade, the FBI’s background check system used for gun transfers, the National Instant Criminal Background Check System, has been compared against the Known or Appropriately Suspected Terrorists file, a subset of the Terrorist Screening Database, or TSDB.

“Since 2004, as part of its background checks for all potential firearms purchasers, the NICS has searched a file containing a list of known or suspected terrorists that is exported by the Terrorist Screening Center from the TSDB into the FBI’s National Crime Information Center database,” says the reply filed by the Department of Justice last month.

The process, as outlined by the government, is straightforward. On a potential gun sale, a Federal Firearms License holder has the buyer fill out an ATF Form 4473 and begins a background check through NICS. As part of the NICS check, if a potential match is found in the TSDB, instead of a “proceed” being issued, the transaction is delayed up to three days while the FBI counter-terror case agent, if one exists, is placed in contact with the NICS examiner to determine if the transfer can proceed. If, within 72 hours, the NICS finds justification to deny the transfer they will. If not, the transfer is allowed to proceed.

Between 2004 and 2014, the search procedure identified 2230 potential firearms purchasers on the TSDB file with NICS denying 190 of those purchases after discovering prohibiting information.

The fact that NICS records have bumped up against the terror database is not a secret. In May 2010 Assistant FBI Director Daniel Roberts testified before the Senate on the process. Roberts said that in instances where there were no active investigations on a person on the TSDB and NICS alerted them to a watchlisted person attempting to possess a firearm and/or explosives, the “FBI case agent will open one based on the encounter.”

According to FBI statistics, some 208 million federal NICS checks have been performed between 2004 and 2016. Regardless, the DOJ points out that, by law, any records of searches are destroyed within 24 hours if the firearm purchase is cleared, and within 90 days if the firearm purchase is neither cleared nor denied.

The plaintiffs in the case, several gun rights groups in New York as well as individual advocates, feel the FBI’s has exceeded their statutory authority by linking the two programs, a prospect that has been a political lightning rod for years in the form of controversial “no fly/no buy” legislation.

“The NICS-to-TSDB program is unauthorized and illegal. It’s also unconstitutional,” said attorney Paloma A. Capanna. “Now we have it in writing that it exists and it’s on-going.”

The lawsuit, an appeal of a lower court ruling in April, seeks that the government halts the use of NICS in conjunction with the terror database, saying the action is, “simply a waste of perfectly good civil rights, designed to target and discredit the American gun owner.”