September 29, 2021 | 3:00pm

AnnaLynne McCord says that getting into a BDSM relationship with “Prison Break” star Dominic Purcell helped her work through her past sexual trauma.

The “90210” star says of her former boyfriend, Purcell — whom she describes as a “big, strong, angry Aussie” — “he changed everything.”

McCord, 34, reveals in a candid interview with Giddy’s Marisa Sullivan that she unexpectedly went public with her past sexual abuse when she was pulled onstage at a charity event for survivors.

“When I first told my story, I was dragged up on stage during an event … I was thrown out on stage like a deer in headlights,” she recalled.

Being put on the spot at the gala, she thought, “‘Everything’s been said, everything’s been done’ … I didn’t know what to do, so I said, ‘You’ve heard all the stories from the survivors and the founder, but you don’t know the story of one girl.’ And then I thought, ‘Oh, why did I say that? That was stupid! There’s a thousand people here!’ So, that’s how my story came out.”

Cosmopolitan magazine was covering the event, and reached out to her to do a story in 2014.

“When I was 19, I was sexually assaulted by a friend who was crashing at my home,” McCord tells Sullivan on her Giddy series, “Bare.” “I woke up and he was inside me, and I froze. My whole body … shut down and I didn’t know what to do. Then I blamed myself because I didn’t fight back … Because I didn’t try to stop it.” She’d also told Cosmo that she suffered physical abuse as a child growing up in Georgia.

AnnaLynne McCord and Dominic Purcell in 2016.
AnnaLynne McCord and Dominic Purcell in 2016.
Getty Images

Years later, “I was going through severe panic attacks, and started to undergo PTSD treatment. I literally went into BDSM — bondage, domination, sadomasochism — because I couldn’t feel anything,” McCord told Sullivan.

That was around the same time she also started seeing Purcell.

“Who broke through the wall?” Sullivan asks McCord, who replies, “A very, very ferociously strong man. Dominic Purcell. You might know him from ‘Prison Break’? He was bustin’ up some heads and breakin’ out of prison. It took a big, strong, angry Aussie. I had such severe sexual abuse at such a young age that my body decided, ‘This is unsafe for you to feel.’ So I was completely numb.”

However, “Dom and I … had this relationship. Yeah, Dom was my dom. There are many reasons why that man will be my forever person … he’s staying at my house right now — we’re not together we’re family is what it is now.”

She says that Purcell “was a mirror back to me,” and that “Dom created space for me, but he called me the f–k out, he did not take bulls–t, and that’s why I trusted him. I trusted no masculine energies, I trusted no men. Because I figured, ‘I’m going to push every f–king button that you have, and if you cave, I can’t trust you.’” But “he changed everything.”

McCord also says of her connection with Purcell: “There was a sexual aspect that was underlying, that was pulling us … and we had explosive sex.”

The on/off couple seems to currently be off, according to McCord’s Giddy chat.

The pair began dating in 2011, and announced their first breakup in 2014. They then reportedly renewed their romance again a year later, but wound up splitting in 2018. By last year, there was speculation that the pair were back on, as they were spotted on a trip to the beach in Southern California together — with lots of PDA.

But in her new Giddy interview, McCord says they’re not together.

McCord was also reportedly with Purcell when he was in a near-fatal accident on the “Prison Break” set in 2016 — which required the actor, 51, to get 150-plus stitches in his head.

Earlier this year, McCord revealed she’s been diagnosed with dissociative identity disorder, previously known as multiple personality disorder.

Giddy’s “Bare” series has also featured Tom Arnold, Jillian Barberie and Gretchen Rossi, among others.