• "Dune" star Rebecca Ferguson said she is highly claustrophobic
  • She made sure she had an "out" whenever she had to be locked into something during filming
  • The actress shared that her terror was pushed to its limit when she was trapped in a birdlike flying machine called an ornithopter

Rebecca Ferguson is opening up about her experience filming her upcoming film, "Dune."

The 37-year-old Swedish actress — who plays Lady Jessica, the concubine of Oscar Isaac's Duke Leto Atreides, in Denis Villeneuve's new adaptation of the classic novel "Dune" — revealed that she had to face her greatest fear while filming the epic sci-fi movie in Abu Dhabi and Jordan's Wadi Rum valley.

"I can't be locked in," Ferguson, who is highly claustrophobic, told Entertainment Weekly. "On every set, I always have to make sure that if they lock me into something, there needs to be an out."

Ferguson recalled one particular "Dune" scene in which her terror was pushed to its limit. While trapped in a birdlike flying machine called an ornithopter, she shared that "there was a moment when I panicked and I literally took my foot and just kicked the door out."

"I needed to know I could get out," she explained.

Aside from enclosed spaces, Ferguson said she is also afraid of being typecast nowadays. Since making her acting debut at the age of 16, she was cast as Elizabeth Woodville in BBC's "The White Queen" and British spy Ilsa Faust in the "Mission: Impossible" franchise in 2015's "Rogue Nation." She has since received more opportunities and offers.

"When Denis explained Jessica, he said, 'She's strong, we see the film through her, she can kick ass.' And I was like, 'Oh, great, so it's basically Ilsa Faust and every other queen that I've done,'" Ferguson said. "I think my head went into 'Oh, for God's sake, I'm being typecast as strong female characters.' And I thought, how the hell do I get out of that? It's lovely, but I also find vulnerability really strong. I find fear very interesting."

She made an attempt to break out of typecasting with her film "Reminiscence," which hit theaters and HBO Max last month. Hugh Jackman, her co-star in 2017's "The Greatest Showman," plays the film's protagonist who becomes obsessed with Ferguson’s character, Mae.

According to director Lisa Joy, she and Ferguson talked during their first meeting about how the film would take the idea of "true love" or simple "femme fatale" and "smash the concept to pieces."

"Mae is a character who, like Rebecca, and like all women, is used to the gaze of the world upon her — making assumptions about her, trying to fit her into an easy 'type,'" Joy explained. "Mae uses those assumptions like weapons against anyone foolish enough to underestimate or pigeonhole her. Every part of this unveiling and debunking of stereotypes was deeply contemplated by Rebecca and myself."

According to her "Mission: Impossible" co-star Simon Pegg, Ferguson was very different from her character Ilsa Faust off-camera and was much sillier, naughtier and funnier.

Fans can catch Ferguson on the big screen when "Dune" hits theaters on Oct. 22. The film will also be on HBO Max, only on the ad-free plan streaming in the U.S. for 31 days from its theatrical release.

The Girl On The Train Premiere - Rebecca Ferguson Rebecca Ferguson attends 'The Girl On The Train' World Premiere at Odeon Leicester Square on September 20, 2016 Photo: Karwai Tang/Getty Images