Agents from the Bureau of Alcohol, Tobacco, Firearms, and Explosives smuggled tens of millions of dollars from cigarette sales into a secret bank account in an operation not authorized by the Justice Department.

The operation gave agents a way to fund undercover investigations and pay informants off-the-books without going through mountains of paperwork and close oversight, the New York Times reported.

The secret account is at the center of a federal racketeering lawsuit brought on by a collective of tobacco farmers who say they were cheated out of $24 million.

Two ATF informants received at least $1 million from the $24 million sum, records show.

The scheme relied on fake shipments of snack food disguised as tobacco, and the agents knew what to look for since their job was to catch smugglers.

An export company working with the ATF placed an international order for cigarettes not subject to any American taxes. Big South, the tobacco distributor bought by the tobacco cooperative of farmers that make up U.S. Tobacco, would ship bottled water and potato chips instead of cigarettes to make it look like cigarettes were being exported.

Jason Carpenter and Christopher Small, the owners of Big South and ATF informants, bought the tobacco at a slight markup through a private bank account before they sold the tobacco back to Big South at a higher markup.

The lawsuit describes one deal where the informants bought tobacco at $15 a carton and sold it to U.S. Tobacco at $17.50. The $519,000 profit went into a “management account” controlled by Carpenter and Small that helped pay for ATF investigations.

It is unclear how widely-adopted this practice was at ATF, at what level it was approved, and whether it continues.

Government auditors have previously found problems ATF’s tobacco investigations in a 2013 audit, but this operation went beyond what was found in the audit.

The tobacco farmers are suing a former employee and consultant who worked as informants for ATF, according to court documents.

The informants are maintaining their innocence, and their defense is that they acted on behalf of the U.S. government.

A judge responded to this defense by adding the U.S. government as a defendant.

The Justice Department has blacked out most references to ATF in documents and argued successfully in court to keep some documents in the lawsuit secret, although the Times has fought to make all the documents public.