When a doctor told Ozzy Osbourne that he was HIV positive, the heavy metal madman wanted to kill himself!

But the diagnosis was a mistake, and now the incident is just one of many shocking true-life tales of sex, drugs and rock ‘n’ roll in his new memoir, I Am Ozzy.

The nightmarish ordeal in the early ’80s started after he "boinked this chick at the Sunset Marquis Hotel in West Hollywood," Ozzy writes in the book.

A doctor suggested he get an HIV test, and when he got the results, "I (bleeping) freaked!" the 61-year-old Prince of Darkness told The ENQUIRER in an exclusive interview.

"At the time, I believed it was only gay people who got HIV, and now the doctor tells me I have the bloody plague!

"It was like he’d handed me a death sentence! I literally sank to my knees and wanted to throw up. I was a mess."

But the lab soon called to say the test was "borderline positive." The doctor told Ozzy that he’d have to be retested, but he wouldn’t get the results for a week.

"I told him quite seriously, ‘Look, doctor, I can’t wait that long because I’ll have killed myself by then.’ And I would have," the former Black Sabbath singer told The ENQUIRER.

When Ozzy was retested, the results were negative.

"What happened was that I was doing so many drugs, my immune system was depressed. So it appeared I was HIV positive!" Ozzy said.

"But I can tell you, that was the end of my career as a Casanova. I never cheated on Sharon again."