Updated

As Spencer on "Pretty Little Liars," Troian Bellisario plays an overachieving high school student, often pressured to extremes to succeed. And in a revealing new interview with Seventeen magazine, Troian, 28, admits that she was very similar to her TV character — and it was dangerously affecting her health.

As a high school student, Troian says that she struggled to cope with the new challenges, and things eventually got really ugly. “Being a teenager is chaotic because you’re kind of coming into your own. I didn’t know what was right and what was wrong, so I think I created this bizarre system of checks and balances to create order in my world. But it really backfired.”

Those checks and balances Troian refers to included harming herself and not eating as punishment. “I started self-harming when I was a junior. I would withhold food or withhold going out with my friends, based on how well I did that day in school.”

The self-inflicted harsh penalties Troian leveled against herself were all because she wasn’t sure that she’d be accepted unless she was perfect:

"It was about wanting to please my father and mother and wanting to be perfect to everybody. I just thought if I ever expressed [to my parents] any sadness or anger or anything that’s going on with me, they would disown me. I kept a lot of it bottled up inside, and it turned into self-destructive behavior."

Troian goes on to say that she felt “imprisoned” as a teen. The issues continued until her friends staged and intervention and convinced her to get help, the "PLL" actress says. That’s when she finally began to focus on being happy, instead of trying to please everyone.

Even now, Troian suggests that her recovery is still a struggle. “Honestly, it’s an ongoing struggle,” she says. “Especially for a woman on a show that has the word ‘pretty’ in it! Sometimes I feel like I’m trying too hard, like I don’t belong. I just look around at Lucy Hale, Shay Mitchell, and Ashley Benson and I’m just like, ‘Why am I on this show?’”

Click here for more from the Hollywood Life.