In an emotional interview on Red Table Talk, Hayden Panettiere is opening up about the painful experience of losing custody of her daughter.

In a clip from the conversation, Panettiere says signing the custody papers—which allowed her ex-fiancé Wladimir Klitschko and the father of her daughter, Kaya, to gain full custody—the “most heartbreaking thing I’ve ever had to do in my life.”

“You thought this was an agreement that you came to that it was best that your daughter be with her dad,” Adrienne Banfield Norris asks, referring to Klitschko’s decision to take Kaya to live with him in his home country, Ukraine.

Related: Hayden Panettiere says postpartum depression worsened her drug and alcohol addiction

“At first it was not because it wasn’t a discussion,” Panettiere says. “If [Klitschko] had come to me and said I think because of where you’re at right now and your struggles that you’re having it would be good for her to be over here with me for a while—which if I had probably had enough of a conversation I would’ve said okay that makes sense, I get it, I’ll come there to visit and stuff like that.”

But Panettiere says the custody arrangement wasn’t something she fully consented to, unfortunately.

“I was trying to tell myself that if I’m not OK, if I’m not good, then I cannot be the best mom to you,” Panettiere said. “I was going through such a hard time that I knew the most unselfish thing I could do was to make that hard decision and just try to work on myself.”

“She was almost three, and it wasn’t fully my decision,” Panettiere continues. “In fact, I didn’t even know it was happening until she was already over there.”

Back in July, Panettiere opened up about her struggles with addiction for the first time, publicly. She says severe postpartum depression led her down the slippery slope of alcoholism and addiction to opiates.

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

She says her addiction caused the destruction of her relationship with Klitschko and their daughter.

“I would have the shakes when I woke up and could only function with sipping alcohol,” she said. “It was the hardest thing I ever had to do. But I wanted to be a good mom to her—and sometimes that means letting them go.”

Related: My baby was born addicted to heroin. Here’s how I forgave her birth mom.

After spending eight months in rehab, she says she began to get over the “hump” of her addiction.

“I put a lot of work into myself and I had to be willing to be incredibly honest,” Panettiere explains, saying she still checks in with erself. “This hasn’t been easy and there were a lot of ups and downs, 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.”