A year-long investigation into two large-scale drug rings allegedly operating in the Rochester and Buffalo areas has led to the indictments of 32 suspects, New York State Attorney General Eric Schneiderman and New York State Police Superintendent Joseph D’Amico announced Thursday.

The investigation, dubbed “Operation Crazy Train,” involved multiple law enforcement agencies at the local, state and federal level and resulted in the seizure of nearly $1 million worth of heroin, several hundred thousand dollars worth of cocaine, and tens of thousands of dollars in cash.

The 32 suspects were arrested in a series of overnight raids and charged Thursday in Monroe County Court with felony counts related to the possession, distribution and sale of narcotics, Schneiderman and D’Amico announced.

The two drug rings brought heroin and cocaine into Rochester from New York City, Massachusetts, Pennsylvania and the Dominican Republic, and distributed them throughout the region, authorities said.

The arrests will have “a significant impact on the heroin and drug trade in western New York,” D’Amico said in a statement.

Schneiderman called heroin “one of the deadliest forces attacking communities across New York” in his statement.

Investigators used surveillance and hundreds of hours of wiretaps to make the case, authorities said.

The suspects allegedly used coded language to communicate with cell phones. For example, one suspect was recorded asking another to give him a “Reggie Miller,” a request for 31 grams of cocaine. Miller, a former NBA great, wore No. 31 on his jersey.

The suspects went to great lengths to conceal drugs while transporting them - inside a piece of furniture with a false bottom, packed into side-view mirrors in cars and hidden in secret compartments in backpacks, authorities said.

The investigation was led by New York State Police and the Attorney General’s Organized Crime Task Force.