At the very end of the self-titled 1976 debut album by Tom Petty & The Heartbreakers, after 27 hit-or-miss minutes of swampy rock’n’roll, comes an electric shock. Two guitars make a holy chiming sound over a Bo Diddley-style beat, soon followed by Petty drawling, “Well, she was an American girl/Raised on promises.” The song was “American Girl,” and although it wasn't a hit on its release -- it didn't crack the Billboard Hot 100 -- through the years it became the anthem Petty had intended, a modern standard for millions of American girls (and boys).

Petty considered “American Girl” to be the first installment in a long-running series of songs about people longing for something bigger than their current existence. His sympathy for the title character came naturally: When he wrote the song, it was only a few months after he had left small-town Florida for a music career in Los Angeles. Not yet a rock star, he was living in an apartment next to the freeway in Encino, Calif. He used to tell friends that the sound of the traffic was actually the sound of the Pacific Ocean -- a joke that got a Florida route number and became the lyric “She could hear the cars roll by/Out on 441 like waves crashing on the beach.”

Early on, Petty figured out something crucial that made his music endure: that songs about people striving for their dreams are more powerful if the heroes don’t get what they want. The American girl may never live next to the ocean. Even the losers get lucky sometimes, Petty allowed -- but then he put the happy romance of that song in the past tense. When Petty wrote about a day in the sunshine, he had to puncture its fantasy immediately: “Runnin’ down a dream/That never would come to me.” All those songs feel joyful anyway, not just because The Heartbreakers could play like their amplifiers were on fire, but because Petty cherished the battle more than the victory.

Guitarist Mike Campbell said in 2008 that recording “American Girl” was the greatest highlight of his career: “[W]e had found something really special that no one else could do.”

The song has been covered by artists from Taylor Swift to the Goo Goo Dolls -- not to mention The Strokes taking the central riff for a joyride in their breakthrough hit, “Last Nite.” In 1985, when Petty and The Heartbreakers played the biggest show of their career at the Live Aid festival, they started their set with “American Girl.” And at Petty’s last show ever, on Sept. 25 at the Hollywood Bowl, it was the final song he played.

“American Girl” sets the scene as Jennifer Jason Leigh returns to school in the opening of the 1982 film Fast Times at Ridgemont High. It underscores the triumph of Amy Poehler in Parks and Recreation when she finally launches the Harvest Festival. Just this year, it was an ironic counterpoint to the uncertain fate of Elisabeth Moss in the closing sequence of the first season of The Handmaid’s Tale. It rings true on all those soundtracks, but it has never been better used onscreen than in Jonathan Demme’s 1991 thriller, The Silence of the Lambs. A young woman (Brooke Smith) drives home at night, singing along to the song, keeping time on the steering wheel. She is moments away from a terrible fate, but while she listens to this song, she is free.

This article originally appeared in the Oct. 14 issue of Billboard.