Hayden Panettiere is opening up about how she spent years secretly battling addictions to opioids and alcohol.

"I was on top of the world and I ruined it," the former "Nashville" star revealed for the first time in the new issue of People magazine. "I’d think I hit rock bottom, but then there’s that trap door that opens."

The 32-year-old became a star when she was just 11 years old, appearing in soap operas and the 2000 sports drama "Remember the Titans" opposite Denzel Washington. At age 15, the actress claimed someone from her team began offering her "happy pills" before she would walk the red carpets.

"They were to make me peppy during interviews," Panettiere recalled. "I had no idea that this was not an appropriate thing, or what door that would open for me when it came to my addiction."

HAYDEN PANETTIERE LAUNCHES FUND TO HELP UKRAINIANS ON THE FRONTLINES

Hayden Panettiere

Hayden Panettiere says she struggled with addiction and postpartum depression. (Photo by Roy Rochlin/FilmMagic)

Panettiere noted that as her career skyrocketed, she was drinking and occasionally taking opioids.

"… As I got older, the drugs and alcohol became something I almost couldn’t live without," she admitted.

In 2014, Panettiere took on the role of troubled country singer Juliette Barnes in "Nashville." Her real-life pregnancy was even written into the show, but behind closed doors, the star was struggling.

"Those were really tough years," said Panettiere, adding that in 2014, she suffered from postpartum depression after the birth of her daughter Kaya, whom she shares with ex-fiance Wladimir Klitschko. "I could relate to a lot of those storylines like the alcoholism and postpartum depression. They hit close to home."

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

Hayden Panettiere soap opera

Hayden Panettiere found fame as a child star in soap operas. (Photo by Ron Galella/Ron Galella Collection via Getty Images)

Panettiere said she sought treatment for her depression, but still felt helpless. She began to rely  heavily on alcohol just to get through the day. Panettiere shared that she did not drink during her pregnancy, but she did hit the bottle after her daughter was born.

"I never had the feeling that I wanted to harm my child, but I didn’t want to spend any time with her," she explained. "There was just this gray color in my life."

Panettiere would sneak away to drink, but despite her efforts to hide her addiction, her relationship with the former professional boxer, which first started in 2009, was disintegrating.

"He didn’t want to be around me," she said. "I didn’t want to be around me. But with the opiates and alcohol, I was doing anything to make me feel happy for a moment. Then I’d feel worse than I did before. I was in a cycle of self-destruction."

HAYDEN PANETTIERE CONFIRMS HER DAUGHTER, 7, IS 'SAFE,' 'NOT IN UKRAINE' DURING RUSSIAN INVASION

Hayden Panettiere Nashville

Hayden Panettiere says she identified with her character in ‘Nashville'. (Photo by Mark Levine/Disney General Entertainment Content via Getty Images)

Things only worsened from there.

"I would have the shakes when I woke up and could only function with sipping alcohol," said Panettiere.

In 2018, "Nashville" came to an end. That same year, Panettiere sent Kaya to live with Klitschko, 46, in his native Ukraine. By then the couple had called off their engagement.

"It was the hardest thing I ever had to do," said Panettiere. "But I wanted to be a good mom to her – and sometimes that means letting them go."

HAYDEN PANETTIERE MAKING MOVIE COMEBACK IN 'SCREAM 6' WITH REPRISAL OF KIRBY REED ROLE

Hayden Panettiere Wladimir Klitschko

Actress Hayden Panettiere and boxer Wladimir Klitschko ended their engagement in August 2018. (Photo by Michael Buckner/Getty Images for Earth Day)

Panettiere was later hospitalized for jaundice, a condition that causes the skin, whites of the eyes and mucous membranes to turn yellow. It can be caused by alcohol.

"Doctors told me my liver was going to give out," she said. "I was no longer a 20-year-old who could just bounce right back."

Panettiere entered rehab for eight months. The outlet also shared that within the last year, she also underwent both trauma therapy and inpatient treatment.

These days, the future is looking much brighter for the star. Now sober, returned to work and is reprising her character, Kirby Reed, in the next "Scream" film.

HAYDEN PANETTIERE DEBUTS RADICAL NEW LOOK IN RETURN TO TWITTER AFTER 10-MONTH HIATUS

Hayden Panettiere addiction

Hayden Panettiere said she is now sober. (Photo by Amanda Edwards/Getty Images)

In March, she founded a charity called Hoplon International, which raises funds for Ukraine amid Russia’s invasion. In February, Panettiere told one commenter on Instagram that Kaya, now 7, is safe and not in Ukraine. Klitschko, whose brother Vitali Klitschko is the mayor of the country’s capital, Kyiv, has been supportive of Hoplon’s efforts.

"This hasn’t been easy and there were a lot of ups and downs," she reflected. "But I don’t regret even the ugliest things that have happened to me. I feel incredibly accomplished. And I feel like I have a second chance."