Updated

An HBO producer pleaded guilty ​Tuesday ​to dragging a married Long Island doctor​, unconscious from a cocaine overdose, to the lobby of his drug dealer​ pal​’s Chelsea apartment building ​where he left her to die.

“I was scared, frightened and panicked,” Marc Henry Johnson — a producer of “The Deuce,” an HBO pilot about ​Manhattan’s seedy 42nd Street porn ​and prostitution trade in the ’70s and ’80s — told a Manhattan federal judge​ in his plea​.

The feds said Johnson, 52, helped ex-con James Holder drag Dr. Kiersten Rickenbach Cerveny out of Holder’s apartment after she overdosed from a night of hard partying.

PHOTOS: Hollywood mugshots

Johnson then abandoned ​the mother of three​ as EMT workers arrived to find her unresponsive ​and ​with her panties in her purse, law enforcement officials said.

On Tuesday, Johnson said he did it because Holder demanded that they “get her body out of here” once Cerveny, 38, ​became unresponsive.

Johnson said he wanted to help Holder protect his illegal drug business. “This was wrong,” the Hollywood producer said, his voice quavering.

Johnson ​insisted that he’d t​r​ied to give Cerveny CPR after Holder took off, and ​thatn he called 911 — although​ ​​federal prosecutors ​have said he declined to give his name to emergency operators.

Johnson was ​arrested more tha​​n six months after Cerveny’s death and charged with attempting to distribute cocaine and acting as an accessory after the fact.

He pleaded guilty to one count of acting as an accessory after the fact and is expected to serve no more than two years in ​prison according to the terms of a plea deal he cut with prosecutors.

“Marc Henry Johnson’s immediate response to seeing a dying overdose victim should have been to summon help. Instead, Johnson helped his cocaine dealer cover up the drug crime by moving the victim’s body,” Acting Manhattan US Attorney Joon Kim said​ after the plea​.

Text messages from earlier in the night showed Johnson telling a friend that he planned to head to his dealer​’​s house “for a pickup” before meeting with Cerveny and her friends​ at a bar.

Once Johnson arrived at the girls’ night out on the Lower East Side, “he had a significant amount of cocaine, which he offered to share,” the feds said.

This article originally appeared in the New York Post.