We’ve already seen images of the Twilight star suited up in military fatigues for her latest role in the military drama Camp X-Ray (in theaters Oct. 17). Today’s new trailer marks our first look at Kristen Stewart in action as a guard at the Guantanamo Bay detention camp. It’s a surprising role for the 24-year-old actress, but even more surprising was the news that the part was originally written for a man.

Stewart plays Pvt. Amy Cole who’s newly assigned to Gitmo where she ends up befriending a Muslim inmate against instructions from her superiors. During a Q&A after the movie’s premiere at Sundance earlier this year, the writer-director Peter Sattler revealed that he initially intended Cole to be a man but changed his mind after his wife’s pregnancy inspired him to contemplate strength and gender. "And Muslims’ extremist relationship toward women also complicated [the story,]" he said. “So I clicked into that.”

To prepare for the drama, Stewart watched documentaries about the naval base in Cuba and spent time with a real Marine. “He kind of, in a very accelerated way, whipped me into shape,” she told Vanity Fair. Stewart got so into the role, during which her character walks several rounds in a cellblock that, she joked in an interview, “I forgot how to turn left. I was constantly rotation.”

The role is a major shift for the actress who’s best known for more fantastical films like Twilight and Snow White and the Huntsman. Camp X-Ray got a mixed response at Sundance, though many critics praised Stewart, including David Rooney at The Hollywood Reporter who wrote. “There’s not a moment Stewart’s onscreen here where she isn’t completely transfixing.”