Three New Jersey men were arrested after investigators seized around half a million counterfeit prescription tablets in what authorities called the largest pill bust in the state's history.

Chester Anderson, 44, was allegedly running two storefronts on the dark web to sell fake Xanax pills and other drugs to buyers across the country. Jarrette Codd, 41, and Ronald MacCarty, 51, allegedly helped manufacture the pills, officials said.

During the investigation, authorities seized hundreds of thousands of the fake Xanax tablets, as well as large quantities of drugs including methamphetamine and 500 glassines of heroin laced with fentanyl.

Authorities began investigating the suspects in 2017 after the Manhattan District Attorney's Office in New York was alerted to large amounts of money being withdrawn from ATMs in the five boroughs and New Jersey. The suspicious transactions led authorities to Anderson, Codd and MacCarty.

Manhattan District Attorney Cyrus Vance Jr. said that his office posed as interested buyers and during its sting operation, purchased more than 10,000 tablets from the suspects. They also found that more than 1,000 packages had been shipped to 43 states, Washington, D.C., and Puerto Rico, Vance said.

He said at a news conference Tuesday that the Xanax pills have a street value of approximately $3 million. He said the amount of fentanyl-laced heroin that was seized was "disturbing" because the combination can "be a fatal experience."

Almost all of the packages had a return address that falsely identified the sender with addresses linked to law offices and real estate agencies in New York City, according to a statement from Vance's office.

Anderson and MacCarty allegedly created a shell company to have more than 1,000 kilograms of microcrystalline cellulose, the main ingredient used to manufacture pharmaceutical pills, shipped to an address in New Jersey, according to officials and court documents.

The suspects also allegedly used a cellphone repair shop in Asbury Park, New Jersey, owned by McCarty as a front to purchase pill presses, a powder mixer and "punch dies" which was used to help the counterfeit Xanax pills appear real.

“Not only is this the first time state prosecutors in New York have taken down a dark web storefront, this takedown represents the largest pill seizure in New Jersey’s history," Vance said. "If you are engaging in illicit activity on the dark web, you are on notice: we know how to find you, we know how to put you out of business, and we know how to hold you criminally accountable."

Anderson and his co-defendants were allegedly paid with cryptocurrency, which they then used to fund pre-paid debit cards. The suspects used the debit cards to withdraw large amounts of cash from ATM machines. In total, they laundered more than $2.3 million in proceeds, prosecutors said.

All three suspects were charged with conspiracy and money laundering. Anderson was also indicted on multiple counts of criminal sale of a controlled substance and identity theft. The Middlesex County Prosecutor’s Office is handling the prosecution of the items seized in New Jersey.

A spokesperson for the district attorney's office said Anderson, Codd and MacCarty will be arraigned soon.