Irvin Cartagena "sold fentanyl-laced heroin in broad daylight in New York City" and "dealt the fatal dose that killed Michael K. Williams", said District Attorney Damian Williams in a statement.
Cartagena faces a mandatory minimum sentence of five years in prison, with the possibility of up to 40 years behind bars, after signing a plea agreement stipulating the mix he sold caused the actor's death.
Williams, who starred as Omar Little in the acclaimed television series, died of an accidental drug overdose in September 2021.
The 54-year-old, who played the iconic Baltimore stick-up man in the groundbreaking show, was found dead in his apartment in New York.
Cartagena was among four men charged in February with conspiracy to distribute the tainted heroin that killed Williams.
Prosecutors said the co-conspirators "continued to sell fentanyl-laced heroin in broad daylight" for several months near residential apartment buildings in Brooklyn and Manhattan, even after they learned of the actor's death.
Fentanyl is a synthetic and extremely potent opioid, about 50 times stronger than heroin. The US Drug Enforcement Administration has called it the "deadliest drug threat facing this country."
Cartagena, who also went by "Green Eyes", was arrested in Puerto Rico in early February, a day before the other three were taken into custody in Manhattan.
The New York Police Department sent an undercover informant to buy drugs from the group and recorded a conversation in which one denied selling fentanyl-laced drugs, though tests detected both heroin and fentanyl in the substances, prosecutors said.
The Emmy-nominated actor died from "acute intoxication by the combined effects of fentanyl, p-fluorofentanyl, heroin and cocaine," New York's chief medical examiner ruled.
Williams had been hailed for his role in "The Wire," in which he played a gay armed robber who specialized in holding up drug dealers.
He was also well known for the role of Albert "Chalky" White on the HBO series "Boardwalk Empire."
His work attracted the attention of a future president, with then senator Barack Obama calling Omar "a fascinating character."
The actor had spoken openly of his past struggles with drug addiction and had told US media that he had spent much of his earnings from "The Wire" on narcotics.