Ozzy Osbourne’s representative says the heavy-metal legend has acknowledged the infidelity that led to a separation from his longtime wife, Sharon Obourne, and that he has since sought therapy.

“Over the last six years, Ozzy Osbourne has been dealing with a sex addiction,” the representative told People magazine Wednesday. Referring to Beverly Hills-based celebrity hair-colorist Michelle Pugh, the rep said Osbourne, 67, “is sorry if Ms. Pugh took their sexual relationship out of context.”

The statement added that the Black Sabbath singer “would like to apologize to the other women he has been having sexual relationships with. Out of the bad comes good. Since his relationship with Ms. Pugh was exposed, Ozzy has gone into intense therapy. Ozzy is mortified at what his behavior has done to his family. He thanks God that his incredible wife Sharon is at his side to support him.”

Sharon Osbourne, 63, said on her daytime show “The Talk” Wednesday that her husband has been receiving outpatient treatment “for sex addiction for the last three months, adding that after the current Black Sabbath farewell tour, “He goes into inpatient for three months. He’s working at it. It’s hard because it affects the whole family and it’s quite embarrassing . . . I’m proud that he’s come out and admitted it, finally . . .” She went on to reflect, “It’s really hard to kind of sit here and you think it’s happening to somebody else, but it’s actually happening to you . . . It’s been going on for at least six years.”

Meanwhile, Pugh on Wednesday sued the Osbournes’ daughter Kelly, 31, for a series of May 23 tweets that alluded to Pugh without naming her. Pugh’s suit, which cites a three-year romance with Ozzy, says Kelly Osbourne “bullied and harassed” her, and was defamatory in claiming elder abuse. She says the tweets caused emotional damage and affected her business.

Pugh told People, “My relationship was more with this really nice, sweet, funny and cool guy . . . John from England,” using Ozzy’s given name. Acknowledging they are no longer in contact, she said, “He is a grown man. He is capable of making the decision to be with me. If he has chosen to not be, that is fine. I accept it and move on,” adding, “But he has been my best friend for the last few years, so of course I am grieving the loss for that.”

advertisement | advertise on newsday

On May 8, without disclosing reasons, an Osbournes representative told Rolling Stone magazine that, “At this time, Ozzy is not in the marital home.” The next day, Sharon Osbourne, 63, skipped her appearance as a panelist of her daytime talk show “The Talk,” returning the following day and expressing misgiving over her marriage.

Yet on July 25, Ozzy Osbourne said on “Good Morning America” that he and Sharon Osbourne were working out their issues, calling them “just a bump in the road” and saying the marriage was “back on track again.” Sharon Osbourne confirmed on “The Talk” that day that, “He’s very embarrassed and ashamed about his conduct . . . I can’t speak for him, but for me, yes, I forgive. It’s gonna take a long time to trust, but we’ve been together 36 years, 34 of marriage . . . I just can’t think of my life without him…,” adding , “. . . even though he’s a dirty dog. He’s gonna pay big!”

Black Sabbath is playing the Nikon at Jones Beach Theater in Wantagh on Aug. 17 as part of the band’s farewell concert tour.