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.