A version of this story appears in the latest issue of Entertainment Weekly, on newsstands Friday. Buy it or subscribe for more exclusive interviews and photos, only in EW.

How do you prepare to play one of the most famous (and famously enigmatic) performers in history? For Rami Malek, and his upcoming role as Freddie Mercury in Bohemian Rhapsody, you remember that underneath all the pomp and circumstance of Queen’s frontman was an individual coming to terms with himself.

“I would consistently go back to his interviews and performances just to understand the [different] sides of him,” the Mr. Robot star says. “Obviously, there is a very brave, brash entertainer who hits the stage. And then there is a human being who can be reclusive and lonely behind closed doors. It was a challenge just to correlate who this person was — someone who had grown up in Zanzibar and got shipped off to school in Bombay, and upon his return to Zanzibar, fled a revolution with his family and went to London. That type of childhood is emblematic of someone who is starving for identity.”

Bohemian Rhapsody
Credit: Alex Bailey/Fox

That duality gave the 37-year-old actor a pathway to capturing the late singer’s magnetism. Malek was so committed to the role that he even flew to London on his own dime to do research before the film had funding. There he immersed himself in all things Freddie, reading biographies, watching old videos, and speaking with Queen members Roger Taylor and Brian May, who were on board with the film early in development. “They gave us creative freedom,” says producer Graham King of Mercury’s bandmates. “I wanted to keep them as involved as possible. I needed their blessing for my own personal peace of mind.” By the time Bohemian Rhapsody finally went into production, Malek, sporting fake teeth for Mercury’s signature overbite, was ready to go. “When you put in those teeth,” he says, “there’s a very visceral change to the performance. When I took them out by the end of the film, I felt quite naked.”

Making it past the finish line wasn’t easy, though, as the long-gestating biopic has, over the years, occasionally resembled an episode of VH1’s Behind the Music: rumors about the script having Freddie die midway through; the firing of director Bryan Singer more than halfway into production when he wasn’t showing up to set; and accusations of producers mishandling Mercury’s sexuality. “I think it’s a very balanced film that shows both sides of his sexuality,” says Graham. “We don’t disrespect that.”

Despite the frustrations, the cast and filmmakers were determined to tie things up. “I can wholeheartedly say I would never let this film be unfinished,” says Malek about Singer’s firing. “Every moment where there was a challenge on set, I just reminded myself: What would Freddie do? And I guarantee, he would’ve seen it through.”