The Queen biopic “Bohemian Rhapsody” had already cleaned up at the box office before taking the top movie prize at the Golden Globe Awards and receiving five Oscar nominations, including for best picture.

But the movie’s success, which includes an acting Golden Globe win for star Rami Malek, comes after years of delays and behind-the-scenes drama.

In 2010, Queen guitarist Brian May confirmed that a movie about the band was in the works, with shooting slated to begin in 2012, and comedic actor Sacha Baron Cohen tapped to play Freddie Mercury.

“We have Sacha Baron Cohen, which will probably be a shock to a lot of people, but he’s been talking with us for a long time,” May told the BBC. He also said Cohen had been in negotiations about the film for a couple of years already.

May also told the Daily Record that some members of Queen had been reluctant to make a movie about the band: “Freddie’s legacy is very precious, and we have a great responsibility not to mess it up. It is more about Freddie than it is about us and that is deliberately so.”

But they finally agreed, in big part because of Cohen “pushing and pushing.”

“He is passionate about playing Freddie,” May said. “For years, he’s been saying he is going to do it.”

Producer Graham King helped usher the movie, with the surviving members of Queen cited as producers, but even in the early stages, screenwriter Peter Morgan said about the band: “I’m not sure how much they’ll like what I write. I think they’ll recognize the truth in it, but it’s a series of painful memories for them.”

By 2013, Cohen had left the project over creative differences, namely that he wanted to tell a gritty, R-rated story while the band wanted to make a PG version. Years later, he would explain that he didn’t want to hold back in showing Mercury’s “extreme lifestyle."

“There are amazing stories about Freddie Mercury,” Cohen told Howard Stern in 2016. “The guy was wild.”

This biographical film about the British rock band Queen focuses on lead singer Freddie Mercury's (Rami Malek) life. (20th Century Fox)

Still, Cohen said: “They are a band, and they want to protect their legacy as a band, and I fully understand that,” but he also regretted continuing with the project after an initial meeting in which a member of Queen said that Mercury’s death should come at the midway point, and the rest of the film should show how the remaining bandmates continued on.

“I said, ‘Listen, not one person is going to see a movie where the lead character dies of AIDS and then you carry on to see the band,’ ” Cohen recalled. (May, for his part, disputed that characterization, saying, “We had some nice times with Sacha kicking around ideas, but he went off and told untruths about what happened.”)

But that wasn’t the end of the film’s troubles. With Cohen out, the search was on for a replacement. In 2013, Ben Whishaw was tapped to play Mercury, with Dexter Fletcher directing.

But a year later, Whishaw said: “I don’t know what’s happening. It seems to be on the back-burner,” telling Time Out London that the movie “was going, then there were problems getting the script working.”

In 2015, Anthony McCarten (“Theory of Everything”) was brought on to write the script, with the first draft written by Morgan (“Frost/Nixon”).

Finally, in 2016, Malek officially joined the production to play Mercury in a role that would eventually earn him his first Golden Globe. Bryan Singer (of the “X-Men” movies) was hired as director.

By 2017, production had shut down with just weeks to go, and Twentieth Century Fox said in a statement that it had fired Singer, with a person close to the situation telling The Washington Post that the reason was unreliable behavior. According to the Hollywood Reporter, Singer’s prolonged absences created chaos on set and tension with Malek. Singer, for his part, said he was caring for an ill family member and denied troubles with Malek.

The directing hire turned out to be controversial choice, especially during Hollywood’s current moment of reckoning with sexual misconduct. Singer has been accused of sexual assault by multiple people. He has denied the claims.

Fletcher returned to finish filming, but Singer is still named as director on the movie’s credits.

In early January, when “Bohemian Rhapsody” won the best motion picture, drama prize at the Globes, there was no director standing onstage to accept the award nor any mention of them. King, the producer involved from the beginning, accepted the prize, thanking Mercury “for showing us the power of embracing your true self.”

“The power of movies is that it brings us all together. Freddie Mercury and Queen did that so successfully through their music,” King said.

View this post on Instagram

What an honor. Thank you #HollywoodForeignPress

A post shared by Bryan Singer (@bryanjaysinger) on

But when asked about Singer’s departure backstage, King reportedly said: “That’s not something we should talk about tonight.”

The day after the Golden Globes, Singer posted a photo on Instagram, showing him in the director’s chair on set.

“What an honor. Thank you," he wrote.

This post, originally published Jan. 7, has been updated.