Authorities raided a major heroin mill in The Bronx Thursday, nabbing four dopey-looking dealer suspects in sweaty T-shirts and seizing $5 million in drugs.

Orlando Rosario-Concepcion, 38, the accused ringleader, Jonathan Almonte, 29, Jean Carlos Rosario-Ortiz, 29, and Rodolofo Abreu-Cristolomo, 31, were arrested inside a very steamy apartment at 238 W. 238th St. near Van Cortlandt Park.

When authorities burst into the Bronx mill, two of the defendants jumped out a window onto the fire escape in a failed attempt to flee, prosecutors said.

The sloppy quartet, dressed for bed, were arraigned Friday in Manhattan Criminal Court on charges of possession of a controlled substance and using drug paraphernalia.

Manhattan Criminal Court Judge Guy Mitchell remanded Rosario-Concepcion and Almonte and set $300,000 bail for Abreu-Cristolomo and $100,000 bail for Rosario-Ortiz. “Sadly, an untimely death from a heroin overdose triggered this investigation, but as a result our collaborative efforts prevented more than a million bags of heroin from hitting the streets,” said Special Prosecutor Bridget G. Brennan whose office is prosecuting the case.

Concepcion’s drug-trafficking operation, based out of the Bronx mill and another location in Washington Heights, supplied dealers locally, Upstate and on Long Island, court papers show.

Agents also raided multiple stash locations, including Concepcion’s New Jersey home, recovering in total approximately $115,000 in cash, two guns and 26 pounds of heroin.

The investigation, conducted by the Office of the Special Narcotics Prosecutor, the DEA and other agencies, began in October of 2014 following a heroin overdose in Sullivan County, authorities said.