A Chelsea dentist who admitted to peddling child pornography and exchanging root canals for meth was sentenced to 10 years behind bars in Brooklyn federal court Tuesday.

John Wallace Wolf, 62 — who was busted with a flash drive containing pornographic videos of children between ages 5 and 13 — took a sweetheart plea deal in October 2017. Before the plea he faced up to 60 years in prison if convicted at trial.

A remorseful Wolf told Judge William Kuntz III, “For 35 years I was called a weekend warrior [using drugs and alcohol] which quickly led me into dark rooms. I shudder at the fact that I contributed to sex trafficking and sexual abuse of children.”

But he hedged, “I am not a pedophile.”

Brooklyn Assistant US Attorney Moira Penza shot back, “to excuse his behavior is unacceptable. He was interested in child pornography and bestiality.”

Wolf, who advocated for AIDS patients in the 1980s, “was poking holes in condoms knowing he is HIV positive,” Penza added.

Wolf’s lawyer asked Kuntz for leniency requesting he impose a 5-year sentence.

The dentist, who once had a practice next to a preschool, admitted to an undercover agent that he was excited by child pornography videos including one of a mentally challenged 8-year-old girl having sex, court documents from his arrest alleged.

In wiretaps, he also allegedly admitted he frequented underground animal sex parties even bragging about raping a dog, prosecutors alleged.

When Wolf is released he will have to register as a sex offender.