Federal agents and Boston police have seized more than 33 pounds of fentanyl — enough of the deadly synthetic opioid to theoretically kill every man, woman and child in Massachusetts — funneled in by Mexico’s vicious Sinaloa cartel.

A lengthy wiretap operation by a joint task force including Drug Enforcement Administration agents and Boston police resulted in an

early-morning sweep of the drugs and 37 suspects, including alleged kingpin Robert Contreras, 42, of Roxbury.

Suffolk District Attorney Daniel F. Conley called the investigation “one of the longest, most far-reaching and most successful state wiretap investigations in Massachusetts history. … But it did not stop there. It continued up the ladder to identify a second group at the top of the domestic pyramid, one with direct ties to Mexico’s Sinaloa cartel.”

Contreras was ordered held on $1 million bail during his arraignment yesterday on charges of trafficking fentanyl, heroin and cocaine.

The six-month investigation first led to the arrest late last year of Edward Soto-Perez, 43, of Roxbury, who led a group that would distribute drugs obtained from Contreras throughout Massachusetts and as far away as Pennyslvania, Conley said.

“We allege that the Contreras organization worked with members of the Sinaloa cartel, one of the most powerful drug-trafficking organizations in the world, who imported huge quantities of narcotics into the northeastern United States,” Conley said. “In fact, we believe they were so high in the distribution structure that the next level up would take us outside the United States. Evidence suggests that the Contreras organization would receive those cartel narcotics and distribute them to the Soto-Perez group and others, who would in turn supply lower-level dealers.”

In total, 77 pounds of drugs were seized, including heroin, cocaine and opiate tablets in addition to the fentanyl. Authorities said they confiscated $300,000 in drug money.

Michael J. Ferguson, DEA’s special agent in charge of the New England Division, likened fentanyl to a weapon of mass destruction.

“You take a sweetener packet that has 1,000 milligrams in it that you put in a cup of coffee. It takes only two milligrams and it’s lights out for an individual,” Ferguson said. “We’re talking a couple of grains of salt or sand. It can kill you if you inject it in your arm, if you snort it up your nose or simply breathe it in the air. Drug traffickers are now lacing fentanyl not just with heroin, but with cocaine as well. As well as in pain pills, counterfeit pain pills made to look like Percocet.”

The 33 pounds of fentanyl seized is enough to kill more than 7 million people in its raw form, a law enforcement source told the Herald. The Bay State’s population is 6.8 million, census figures show.

The investigation began in July focusing on Soto-Perez, who was “extremely diligent” in concealing his moves using couriers for deliveries, switching cars to foil authorities and making several turns in the span of a mile to spot surveillance, Conley said.

Conley’s office then took the rare step of approving a wiretap application to get critical evidence about Soto-Perez’s suppliers and stash houses. In following months, the court extended the wiretap 11 times and approved interceptions on more than two dozen phones. The wiretaps led authorities to Contreras, Conley said.

“In some calls, the defendants referred to drug shipments as ‘musicians’ and to payments as ‘tickets’ to the party,” the DA said. “In others, they discussed purity levels by referring to a kilogram of cocaine as a ‘car’ that could fit ‘three passengers’ — a highly potent original product that could be quadrupled in retail weight with cutting agents.”

Joe Dwinell contributed to this report.