Take some hard rock, toss in a little James Brown and a bit of New Orleans funk, and what do you have? In Aerosmith's case, a classic single — albeit one that needed a second chance to truly catch on.

The song in question, "Walk This Way," was recorded during the sessions for the band's third album, 1975's Toys in the Attic. According to singer Steven Tyler, the tune's undeniable groove grew out of some pre-show goofing around between himself, drummer Joey Kramer and guitarist Joe Perry.

"The song started at a sound check at HRC in Honolulu," Tyler told NME. "It was a real rhythmical thing. Our drummer Joey Kramer played with a funk band and was always pushing James Brown. He brought funk to the table. And Joe picked up on it and brought that 'Walk This Way' lick.

"The groove kind of lent itself to rap," he added. "It kind of pissed me off at first that they weren't following the lyrics, but they were following the rhythm. But I would scat, and then write the lyrics in after. I wrote them on the hallway wall."

Perry, in an interview with the Wall Street Journal, said Aerosmith "were heavily into funk and soul. Jeff Beck had turned me on to the Meters, and I loved their riffy New Orleans funk, especially 'Cissy Strut' and 'People Say.'

"In December of '74, we flew to Honolulu to open for the Guess Who," Perry remembered. "During the sound check, I was fooling around with riffs and thinking about the Meters. I asked Joey to lay down something flat with a groove on the drums. The guitar riff to what would become 'Walk This Way' just came off my hands."

Listen to Aerosmith Perform 'Walk This Way'

According to bassist Tom Hamilton, the final touch of inspiration came from a screening of the Mel Brooks classic Young Frankenstein.

"There was a part where the main character arrives at the train station in Transylvania and he’s met by this classic evil assistant, who takes his suitcase for him and hobbles down the steps and says ‘Walk this way,’ and to humor him he follows him down the steps the same way," he told Spin. "So we told Steven, you’ve got to call the song 'Walk This Way.' Steven was like, 'You can’t tell me what to call the song. I haven’t even written the lyrics yet!’ But we told him he had to do it. So he did."

Though it would soon become an Aerosmith standard, "Walk This Way" initially failed to chart when it was released as the second single from Toys in the Attic on Aug. 28, 1975. It wasn't until the song was reissued the following year that it started to take off — and rose all the way to No. 10, giving the young band its biggest hit to that point.

Plenty of successful singles followed, but "Walk This Way" remained one of Aerosmith's definitive hits — and the song ended up adding some unlikely fuel to the band's late '80s comeback after they re-recorded it as a duet with Run-DMC.

As Tyler later admitted in his NME interview, the rap-friendly arrangement that inspired his hallway-scribbled scatting was a forward-thinking stroke of genius — even if he didn't have any idea how it would pay off in 1975.

"I didn't really know too much about hip-hop at the time," said Tyler. "I remember the time: You would get cassettes from DJs, great people, mostly downtown. I'd love to say, 'I knew what rap was, hell yeah.' But that's horseshit. Am I fan of rap now? FROM THE WINDOOOOOOW TO THE WALL, TILL THE SWEAT DRIPS DOWN MY BALLS! It's fuckin' great."

Aerosmith Albums Ranked

Any worst-to-best ranking of Aerosmith must deal with two distinct eras: their sleazy '70s work and the slicker, more successful '80s comeback. But which one was better?

Why Don't More People Love This Aerosmith Album?

More From Ultimate Classic Rock