Most people hear “Me and Bobby McGee” and think of Janis Joplin. Her version went to No. 1 in 1971 and never really left the radio.

But nearly two years before that, Kenny Rogers was already singing it. And Kris Kristofferson, the man who wrote it, had not even put out his own recording yet.

A song that started as somebody else’s idea

In the late 1960s, Kris Kristofferson was writing songs for Fred Foster, the man who owned Monument Records. One day Fred Foster handed him a title.

“I got a song title for you: ‘Me and Bobby McGee.'”

Kris Kristofferson did not love the idea. “God, I can’t write on assignment,” he said later. “It gives me the worst case of writer’s block that I’d ever seen.”

Then Fred Foster told him something that made it even harder. Bobby McGee was not a man. She was a woman.

“He told me Bobby McGee is a she! And I thought, ‘Oh God, I’ve got to start over.'”

The name came from a real person. The songwriter Boudleaux Bryant had an office in Fred Foster’s building, and his secretary was named Bobbie McKee. Kris Kristofferson misheard it. “I thought he said ‘McGee,'” he admitted.

He was flying around Baton Rouge at the time, working down in the Gulf of Mexico. By his own account, he hid from Fred Foster for a couple of months. Slowly the idea grew. The last piece came to him while he was driving to the airport in New Orleans. He also said he was trying to capture the hopeless feeling at the end of the Fellini film La Strada, where a broken man sits alone on a beach and finally cries.

When it was done, he and Billy Swan stayed up all night making the demo.

Roger Miller first, then Kenny Rogers

The demo got around fast. In May 1969, Roger Miller became the first artist to record “Me and Bobby McGee.” His version climbed to No. 12 on the Billboard country chart.

Only a few weeks later, Kenny Rogers and The First Edition cut it too. The group was riding high that year with “Ruby, Don’t Take Your Love to Town,” and they put “Me and Bobby McGee” right behind it, as track two on the album of the same name.

The record company never released Kenny Rogers’ version as a single. It stayed an album track. But it was out there in 1969, with Kenny Rogers singing a song by a writer almost nobody outside Nashville had heard of.

The songwriter who was still waiting

Kris Kristofferson did not release his own version until June 1970, on his first album, simply called Kristofferson. It sold only about 30,000 copies that year. By most measures, it was a flop.

Then the song took a turn nobody planned. While Kris Kristofferson was away in Peru working on a film, his friend Bob Neuwirth taught the song to Janis Joplin. She recorded it in September 1970, for the album that would become Pearl.

Janis Joplin died in October 1970, just days after finishing it. Kris Kristofferson had no idea she had recorded the song. He heard it for the first time the day after she died.

Her single came out in January 1971 and went all the way to No. 1 on the Billboard Hot 100. It was her only No. 1, and only the second song in American history to top that chart after the singer had died.

Suddenly everyone wanted Kris Kristofferson’s version too. Monument reissued his flop debut album under a new name: Me and Bobby McGee.

The version most people never heard

Today, the Janis Joplin recording is the one in the Grammy Hall of Fame. Roger Miller’s is the one country fans remember as the first. Kris Kristofferson’s own gravelly reading is the one many songwriters love most.

Kenny Rogers’ version sits quietly in between. No hit single, no famous story. Just a young band from Houston who heard something special in a song about a woman named after a secretary, and recorded it before the rest of the country caught on.

Kenny Rogers went on to become one of the biggest stars country music has ever had. Kris Kristofferson became one of its greatest songwriters. In the spring of 1969, before either of those things had fully happened, their names were already on the same record.

Do you remember the first time you heard “Me and Bobby McGee”? Whose version was it?