“Under Pressure” marked the union of two of rock’s preeminent forces in Queen and David Bowie. But there were multiple times along the way where the session could have been derailed.

Even the timing was a stroke of luck. Queen was working at their studio in Montreux, Switzerland, where Bowie had a nearby residence when he heard they were in town. “Since we already knew him a little, he popped in to say hello one day while we were recording,” Brian May later told the Mirror, adding that they “very quickly decided that the best way to get to know each other was to play together.”

Queen and Bowie jammed through covers and the occasional piece of original material, generally having some fun without any kind of clear direction. "I think the process was we were all drunk and in the studio and, just for fun, we were playing all sorts of old songs," drummer Roger Taylor would later admit.

Then Bowie made a suggestion: “David said, 'Look, hang on a minute. Why don't we write on of our own?'" Taylor added. May said “we all brought stuff to the table, but what we got excited about was a riff which [bassist John Deacon] began playing – six notes the same, then one note a fourth down,” he told the Mirror.

Deacon’s riff had sparked something, but then they suddenly felt another calling: hunger. Putting the session on pause, Queen and Bowie adjourned to a local restaurant where they reportedly enjoyed “food and a fair amount of drink.”

Watch the Video for Queen and David Bowie's 'Under Pressure'

Returning to the studio, they aimed to pick up with Deacon’s piece – but no one could agree on exactly how it went. “What was that riff, you had, Deacy?” May recalled Bowie asking. “‘It was like this,’ says John Deacon. ‘No it wasn’t,’ says Bowie. ‘It was like this.’”

May later referred to this instance as a “tense moment,” suggesting it was the first time during the collaboration that egos began creeping in. “It could have gone either way,” he told the Mirror. “Deacy did not take kindly to being told what to do.”

Things didn’t escalate, and everyone continued pressing forward. Elements from “Feel Like,” a song they’d abandoned earlier, were added into the mix with Deacon’s new bass part and some of Bowie’s concepts. The instrumental part of the song had taken shape, but they still had to figure out a lyrical approach.

“The vocal was constructed in a very novel way, which came through David – because he had experience of this avant-garde method of constructing the vocals,” May said during an interview with Ultimate Classic Rock Nights. “He said, ‘Everybody just goes in there with no ideas, no notes, and sings the first thing that comes into their head over the backing track.’ So we all did, and then we compiled all the bits and pieces.”

This rough version, assembled from various parts of everyone's turn recording vocals, was given the tentative title “People on Streets.” The next day, a new name would emerge – but only after Bowie made it clear that he wanted a larger creative role.

“David was in there first and told us he wanted to take the track over, because he knew what he wanted it to be about,” May told the Mirror. “We all backed off, and David put down a lyric which now focused on the ‘Under Pressure’ part of the existing lyric. It was unusual for us all to relinquish control like that but, really, David was having a genius moment – because that is a very telling lyric.”

Watch David Bowie Perform 'Under Pressure' 

May described the working situation as “hard, because you had four precocious boys and David, who was precocious enough for all of us. David took over the song lyrically,” he told Mojo in 2008. But May argued that Bowie’s leadership was necessary to make “Under Pressure” as good as it could possibly be.

“Somebody has to take the helm,” May said on Ultimate Classic Rock Nights. “Somebody has to decide what you actually use. And, really, to be honest, that person was David, because he just went, ‘I’m doing it; I’m doing it,’ being David Bowie. And we went, ‘Ooh, okay.’”

The result was one of the most dynamic songs in rock history, though “Under Pressure” ended up requiring one more compromise before reaching fans. Bowie insisted on leading the mixing sessions, with Mercury and Taylor also playing an active role.

Still dissatisfied, Bowie seemed poised to block the track’s release but they eventually settled on a mix and and “Under Pressure” arrived on Oct. 26, 1981. The single became a worldwide hit, reaching No. 1 in the U.K. while topping out at No. 26 in the U.S.

Now regarded as one of the greatest collaborations in rock history, “Under Pressure” has been covered by scores of other artists in the years since its release. Bowie and Mercury never performed the song together in concert, though Bowie occasionally played it live – including a duet with Annie Lennox at the Freddie Mercury Tribute Concert in 1992, among others.

The Most Shocking Rock Star Fashion Reinventions

From David Bowie to Metallica, these are the most shocking rock star fashion reinventions.

You Think You Know Queen?

More From Ultimate Classic Rock