One of the most iconic rock songs of all time may never have existed if it weren’t for the Rolling Stones' Keith Richards’ uncanny ability to write songs in his sleep.

The Stones' 1965 hit “(I Can’t Get No) Satisfaction” features one of the most famous intros in music history, but the track is legendary for more just than that — it was taped on a cassette recorder by Richards while he was asleep. The rocker awoke the following morning and listened to his recording from the night before, which also featured 40 minutes of snoring, and had no memory of creating the bones of the iconic song.

The song, released in May 1965, went on to be the band's first No. 1 hit in the United States and stayed at the top of the charts for 14 weeks. It even snagged the second-place spot in Rolling Stones 500 Greatest Songs of All Time list in 2011.

“Every time I play ‘Satisfaction,’ I’m finding new ways, just a little lick here and a little lick there,” Richards told CBS News in 2016. “The fact is, the way things go, you write songs and five days later you recorded it. You barely know the thing. Then you take it on the road for 50 years and I’m starting to get the hang of it now.”

Rolling Stones
(L-R): Mick Jagger, Brian Jones, Keith Richards, Bill Wyman and Charlie Watts in 1965
Photo: Jeff Hochberg/Getty Images

Richards had 'no idea' he'd written the song when he woke up

The time was May 1965, but the place is a little more uncertain. While many sources, including Rolling Stone, report that the famous night happened at a motel room in Clearwater, Florida, during the band’s third tour, Richards tells the story differently in his own 2010 book, Life.

“I was between girlfriends at the time, in my flat in Carlton Hill, St. John’s Wood. Hence maybe the mood of the song,” he wrote. “I wrote ‘Satisfaction’ in my sleep. I had no idea I’d written it, it’s only thank God for the little Philips cassette player. The miracle being that I looked at the cassette player that morning and I knew I’d put a brand-new tape in the previous night, and I saw it was the end.”

Curious about his own nocturnal behavior, he rewound the tape and found 30 seconds of the famous riff and the lyrics that would become the song's title.

“It was just a rough idea,” he said in his book. “There was just the bare bones of the song, and it didn’t have that noise, of course, because I was on acoustic. ...But the bare bones is all you need.”

READ MORE: How Childhood Friends Mick Jagger and Keith Richards Formed the Rolling Stones

Mick Jagger helped with lyrics and the pair built the song's sound together

Richards promptly played it for bandmate and co-songwriter Mick Jagger. “He only had the first bit, and then he had the riff,” Jagger said. “It sounded like a country sort of thing on acoustic guitar — it didn’t sound like rock. But he didn’t really like it, he thought it was a joke… He really didn’t think it was single material, and we all said ‘You’re off your head.’ Which he was, of course.”

Nevertheless, in his book Richards described how the pieces of the song started to come together with Jagger's help while poolside. “Mick wrote the lyrics by the pool in Clearwater, Florida, four days before we went into the studio and recorded it,” Richards wrote.

Though there was some concern that the song was similar to Martha and the Vandellas’ “Dancing in the Street,” according to Rolling Stone, they went with it.

Richards said the songwriting collaboration between him and Jagger was pretty typical. Richards would come up with the song and idea and Jagger would do “all the hard work of filling it in,” he admitted in his book.

But that may be a tad modest. “I wrote the melody, he wrote the lyrics,” he continued. “But the musical riff is mostly coming from me. I’m the riff master.”

Richards’ vision also went beyond what they had done before when it came to the overall sound. “I was imaging horns, trying to imitate their sound to put on the track later when we recorded,” Richards wrote. “I’d already heard the riff in my head the way Otis Redding did it later, thinking, this is gonna be the horn line. ...But the fuzz tone had never been heard before anywhere, and that’s the sound that caught everybody’s imagination.”

"Satisfaction" became the hit song of the summer

Maybe it was the fuzzy way it came to him in the middle of the night, but the vision worked — and the song was an instant hit, even before he was aware it was done.

“Next thing I know, we’re listening to ourselves in Minnesota somewhere on the radio, ‘Hit of the Week,’” Richards wrote, explaining that he was unaware that their manager and producer Andrew Loog Oldham had released it.

“At first I was mortified,” Richards recalled. “Then days on the road and it’s number one nationally! The record of the summer of ‘65. So I’m not arguing.”

He’s repeatedly stuck to the fact that he never saw that kind of potential in the track. “I’m the guy who said ‘Satisfaction’ wasn’t a single. That’s what I know,” he said in a 1981 interview with Rolling Stone.

Richards still enjoys playing the song five decades later

While Richards kept the famous cassette tape for a while, he no longer has it. After all, while it was a mega-hit in the 1960s, the song's creator never imagined this kind of longevity.

“I’d rather be dead than sing ‘Satisfaction’ when I’m 45,” Jagger declared to People in 1975 when he was 31.

However, after playing the song for more than five decades now, Richards has changed his attitude and says he “never” tires playing it. “It’s quite bendable onstage...It’s not the same every night,” he told Rolling Stone in 2007. “It’s a song that you can levitate to, where you suddenly feel that your feet are not quite on the ground, but you’re not gonna fall over. That’s what you look for, to levitate.”