(Warning: This story contains small spoilers for Amazon’s “Good Omens.”)

Any fan of the book “Good Omens” will tell you how central a role Queen’s music played in the story of Crowley and Aziraphale, and the director of Amazon Prime Video’s TV adaptation told TheWrap just how “desperate” he was to obtain the rights to that music.

“If you know the book at all, the Queen joke is a huge one in the book and runs all the way through it,” Douglas Mackinnon told TheWrap. “I was desperate to get the music.”

A running gag throughout the book is that most of the music tapes in Crowley’s (David Tennant) car — a 1926 Bentley — are from Queen. And even the tapes that aren’t Queen still sound like “Queen-ified” versions of other artists. So pretty much every time Crowley drives his car in the Amazon series, there is a Queen song playing — including “You’re My Best Friend” and “We Will Rock You.”

Also Read: 'Good Omens': The Story Behind What's Possibly the 'Longest Cold Open in the History of Television'

But one Queen song in particular — the one they named a movie after — was so important that Mackinnon would have considered scrapping a crucial sequence in the series if they couldn’t secure the rights to the tune. “At one point last year, if we hadn’t got ‘Bohemian Rhapsody,’ I would’ve said maybe we shouldn’t do it,” he said. “It’s a key part.”

That “key part” Mackinnon was referring to comes in the opening episode, when Crowley first gets word, from his car radio, that he’s to deliver the anti-Christ to The Chattering Order of St. Beryl for a baby-swap — which predictably goes wrong — so the son of Satan can grow up and bring about the Apocalypse. “Bohemian Rhapsody” is playing over the scene (and hilariously is interrupted by Crowley getting his orders from a Freddie Mercury impersonator).

“The sequence was working before, but it just started landing once we got ‘Bohemian Rhapsody,'” Mackinnon said.

Also Read: Summer TV Premiere Dates: Here's Every New and Returning Show (Photos)

Mackinnon detailed the process of getting the band to sign off on Amazon and co-producer BBC using their songs, which was complicated by the fact that the Queen biopic “Bohemian Rhapsody” was coming out just seven months before “Good Omens” was set to premiere.

“There was a period last summer, where at the beginning of the summer, when we were in post-production, where Queen was going, ‘Yeah, you can have some of the songs, but certainly not “Bohemian Rhapsody,” because the film is going to come out and we want to keep the timeline clear.’ We kinda got that,” Mackinnon said, adding that Queen guitarist Brian May was supportive throughout the whole process.

Also Read: How 'Good Omens' Feels Like Monty Python - and Why Terry Gilliam Gets Credit for the TV Series

But the film’s production troubles — Bryan Singer was fired as director at the end of 2017 — caused Queen to reconsider, according to Mackinnon. “And I think Queen was going, ‘Well, maybe the film is not going to be so good, so you can have the rights.'”

Of course, the film ended up being a massive success and earned Rami Malek an Oscar for his portrayal of Freddie Mercury.

“Happily for everyone, the film turns out to be a great film and one of the biggest splashes of the year. But we still had the rights. If the timeline for the release of ‘Bohemian Rhapsody’ had been right alongside ours, I completely get why it would’ve been strange for Queen to have ‘Bohemian Rhapsody’ flying around with us as well as with them,” Mackinnon said.

Also Read: 21 Lowest-Rated Broadcast TV Shows of 2018-19 Season (Photos)

Neil Gaiman, who co-wrote the book and wrote and served as showrunner for the TV adaptation, saw the film as a bit of serendipity.

“I was very grateful to Queen for coming back into fashion,” Gaiman said. “The idea of Queen becoming perfectly relevant 30 years after ‘Good Omens’ came out is one that I would never have thought of.”