The Guess Who’s “American Woman” has one of the most recognizable riffs in music, but it almost didn’t get written. As an animated history from the video channel Great Big Story details, the classic anti-war song (revived as a Lenny Kravitz cover on the 1999 soundtrack to Austin Powers: The Spy Who Shagged Me) was the result of an accident onstage during a last-minute show.

The Canadian members of The Guess Who were driving to Texas from Canada when a U.S. Border Patrol officer in North Dakota told them that because of their green cards, they needed to register for the draft, putting them in the pool of candidates to be sent to the ongoing Vietnam War. Panicked, they turned around and booked it back to Canada immediately, taking the first gig they could find, a dance at a curling arena in Waterloo, Ontario.

Onstage during their three-hour scheduled performance, guitarist Randy Bachman broke a string. They didn’t have any spare guitars, so the band took a break while Bachman re-strung and tuned his guitar. In the process, he just started playing a few chords, testing out the strings. And out came The Riff.

“I’m going, ‘Oh my god, I don’t want to forget this riff,’” he tells Great Big Story in the video below. So he starts playing it louder, calling for the band’s singer to come back onstage. “Finally I yelled out, ‘Sing something, sing anything!’ The first thing he sang was ‘American woman.’” Inspiration had struck, and they just rolled with it, creating a modern classic in the process.

Hear Bachman tell the story in his own words in the video below:

The Accidental Origin of the Hit Song ‘American Woman’ from Great Big Story on Vimeo.

Know of something you think we should cover? Email us at tips@mentalfloss.com.