Elton John revealed the death of his friend Ryan White inspired him to get sober.

The 72-year-old shared that prior to the 18-year-old’s passing from AIDS-related pneumonia, he was abusing cocaine and other substances.

“I think the catalyst was Ryan White’s funeral and seeing what Ryan went through,” John revealed on “Today,” as reported by People magazine on Tuesday, about his decision to finally get sober.

“When he died, being there in Indianapolis and coming back to the hotel and complaining about the wallpaper, the décor in the room, [I’m] think, ‘You are the most ungrateful little bastard,’” continued John. “’You complain about everything. This boy has never complained about contracting HIV and AIDS from a blood transfusion. He’s never complained, he’s only encouraged people to get tested. You are a piece of s---.’ And that’s how I felt about myself.”

ELTON JOHN DEFENDS ELLEN DEGENERES, GEORGE W. BUSH'S FRIENDSHIP AFTER TWITTER BACKLASH

Ryan White and Elton John. ((Photo by L. Cohen/WireImage))

ELTON JOHN'S AUTOBIOGRAPHY 'ME' DISCUSSES FRIENDSHIP WITH PRINCESS DIANA, COCAINE USE AND BEING A DAD

White, a hemophiliac who contracted AIDS from blood transfusions, fought a legal battle for five years against school officials who barred him from attending classes, saying he posed a risk to other students. He won that fight, which became the basis of a television movie about his life.

White died on April 8, 1990. Among those who attended his funeral were John, as well as first lady Barbara Bush, Michael Jackson and talk show host Phil Donahue.

In the show, John also shared why he initially started using cocaine.

“I saw someone doing cocaine and I said, ‘Well, what is he doing?’ and he said, ‘Well, it makes you feel free,’” said John. “And I thought, ‘Hmm, I was always on the outside looking in as far as, like, school, and I was never a member of the gang, or whatever. So, I thought, 'I’m going to try that.’”

ELTON JOHN HIJACKED ROLLING STONES CONCERT HIGH ON COCAINE; KEITH RICHARDS WAS NOT HAPPY

Singer Elton John playing piano and singing at the funeral of teenage AIDS victim Ryan White. (Photo by Taro Yamasaki/The LIFE Images Collection via Getty Images/Getty Images)

ELTON JOHN WRITES QUEEN ELIZABETH SLAPPED HER NEPHEW ACROSS THE FACE IN FRONT OF HIM IN NEW BOOK

The star immediately got hooked.

“I liked it because I could talk,” said the singer. “I was very shy, so I thought, ‘This is the drug that has opened me up. I can converse, I can be verbose.’”

The outlet reported that after years of denial, John finally checked himself into Chicago’s Parkside Lutheran Hospital that same year. He has since been sober for 29 years.

Today, John is happily married to David Furnish. The couple shares two sons — Zachary, 8, and Elijah, 6. John also established the Elton John AIDS Foundation, which has raised over $400 million toward fighting the disease.

ELTON JOHN SAYS HIS ‘RAVING SOCIOPATH’ MOTHER ATTEMPTED TO SABOTAGE HIS CIVIL PARTNERSHIP TO DAVID FURNISH

Elton John attends IMDb LIVE At The Elton John AIDS Foundation Academy Awards® Viewing Party on February 24, 2019 in Los Angeles, California. (ich Polk/Getty Images for IMDb)

ELTON JOHN REVEALS HIS MOST 'DIFFICULT' SCENES TO WATCH IN 'ROCKETMAN' BIOPIC

“I could have been one of them,” John admitted. “Of course, I could have become HIV positive; I was very lucky. I was blessed and I always thought it was for the reason, when I got sober, that I would give something back.”

The Associated Press contributed to this report.