When Paul McCartney began writing “She’s Leaving Home,” he didn’t know he had met Melanie Coe. A story in the Feb. 27, 1967 edition of The Daily Mail merely captured the Beatle’s attention. It told of a 17-year-old girl named Melanie who had run away from home, leaving behind a cushy lifestyle and a couple of confused parents.

“I cannot imagine why she should run away,” her father said in the article. “She has everything here … even her fur coat.”

McCartney saw the tale as a parable for the ’60s generation gap – a young girl’s rejection of a respectable life of comfort in “straight” society in favor of running off and having some rock ’n’ roll fun. “Fun is the one thing that money can’t buy,” John Lennon intones toward the end of “She’s Leaving Home.” Although McCartney (and Lennon, who assisted somewhat on the writing of the song) invented many of the details of the story, which was simply based on the news item, he had no idea how well he captured Coe’s life.

Years before, Coe had become a rock fanatic, even appearing on the pop music TV show Ready Steady Go! in the fall of 1963. It was during her appearance that she participated in a contest with three other teenage girls that involved miming (lip-synching and dancing) to a Brenda Lee song. The judge of the contest: none other than the “Cute Beatle,” Paul McCartney. He proceeded to be most impressed by contestant No. 4, the 13-year-old Melanie Coe, presenting her with a Beatles album as her prize.

As the Beatles progressed, so did Coe, who became a fixture on the London rock scene, much to the frustration of her parents. The well-heeled girl shirked her studies in favor of rubbing elbows with rock royalty (including the Fab Four) at Soho’s Bag O’Nails club and engaging in flings with various scenesters. Then, in early 1967, she decided she had had enough of her overbearing parents and planned to run away from home, leaving behind her car and most of her possessions.

“I was 17 by then and ran away leaving a note, just like in the song,” Coe told The Guardian in 2008. “I went to a doctor and he said I was pregnant, but I didn’t know that before I left home. My best friend at the time was married to Ritchie Blackmore, so she hid me at their house in Holloway Road. It was the first place my parents came to look, so I ran off with my boyfriend, who was a croupier, although he had been ‘in the motor trade’ like it says in the song. I think my dad called up the newspapers – my picture was on the front pages. He made out that I must have been kidnapped, because why would I leave? They gave me everything – coats, cars. But not love. My parents found me after three weeks and I had an abortion.”

McCartney knew little of this – just what had been in the paper – when he wrote “She’s Leaving Home,” inventing details like the note and the “man from the motor trade,” which some listeners would take to be code for having an abortion (true facts in the real life of Melanie Coe). While McCartney fictionalized his version of the runaway teen, Lennon contributed the parents’ perspective. McCartney credited Lennon with adding the “Greek chorus” of the older generation wondering where everything went wrong. Lennon drew on his personal experience, specifically being raised by his Aunt Mimi, to capture the mood of the parents.

“Paul had the basic theme for this song, but all those lines like ‘We sacrificed most of our life … We gave her everything money could buy,’ those were the things Mimi used to say to me,” Lennon said. “It was easy to write.”

Excited by his and Lennon’s lyrics, McCartney became eager to get “She’s Leaving Home” recorded. As a continuation of the Beatles’ previous uses of orchestration (“Yesterday” and “Eleanor Rigby”), he thought a string ensemble would bring the correct tone to the song. He called up producer George Martin – who had arranged the strings on those songs – to invite him over the next day to write the orchestral backing. But Martin, who produced other artists, already had a session booked with Cilla Black. The scheduling conflict caused hurt feelings on both sides.

McCartney became annoyed that Martin wouldn’t drop everything to work on his latest idea. Refusing to wait for the producer to become available, he contacted another man who could do the job – Mike Leander, who had arranged the strings on recordings by Ben E. King and the Drifters. Leander was available to meet with McCartney on short notice. He listened to the Beatle’s ideas and left to craft the string arrangement for harp, violins, violas, cellos and double-bass.

McCartney’s rush upset Martin, who had been the only one to arrange the music on Beatles recordings, other than one of the four band members. Although he was hurt by McCartney’s willingness to work with someone else at a moment’s notice, Martin agreed to still produce the session and conduct the players for the Beatles. He made some small adjustments, but grudgingly admitted that Leander had done a nice job.

The producer wasn’t the only one frustrated by McCartney over “She’s Leaving Home.” Harpist Sheila Bromberg – the first female musician to play on a Beatles recording – had her own run-in with the bassist-songwriter during a session at EMI’s London studios (“Abbey Road”) on March 17. Bromberg was part of a 10-member ensemble that became mystified, then irritated by McCartney’s dissatisfaction with their talents.

“First of all, I played exactly what was written,” Bromberg told the BBC in 2011. “Then I stopped and [McCartney] said, ‘No, I don’t want that. I want something, ehhhh ... ’ I think he had an idea in his head of what he wanted it to sound like but he couldn’t describe it, he couldn’t express it, and he was waiting for somebody to bring it out of the air. During the session, after each time we played it, Paul McCartney, we would hear from the controls, ‘No, I don’t want that. I want something, ehhh ... ’ So we’d play it again.”

After six full takes, the Friday evening session arrived at midnight and the musicians decided they had done their job and were going home. McCartney had no say in the matter. Imagine his astonishment when, on Monday, March 20, engineers Geoff Emerick and Richard Lush found all six takes to be acceptable. They soon decided that the first one was what they’d use for the master, to which McCartney and Lennon would add their vocal parts on this night.

But McCartney’s fussiness wasn’t done having an impact on the recordings. As he and Lennon sat on stools to record their (sometimes long and drawn-out) vocal parts for “She’s Leaving Home,” Lennon began to lose patience with his bandmate’s insistence at doing the takes over and over again.

Ringo Starr and George Harrison were probably happy to not be in attendance, as they didn’t contribute anything to the track. Eventually, Martin, McCartney and Lennon were satisfied and the session was complete.

After everything was recorded, a doubling effect was added to Bromberg’s harp part, perhaps resulting in the sound McCartney had been searching for. For the mono mix, “She’s Leaving Home” was sped up slightly to make McCartney sound younger, a tweak that was forgotten when it was mixed for stereo, resulting in a 10-second longer running time and a lower pitch.

The lush ballad, which features no instrumentation from any Beatles and vocals only from Lennon and McCartney, would become Track Six on Sgt. Pepper’s Lonely Hearts Club Band, released on June 1, 1967.

“She’s Leaving Home” would initially be hailed as an emotional highlight of the album – earning the Lennon/McCartney team an Ivor Novello award – it would be overshadowed by some of the LP’s more experimental tunes.

Meanwhile, even after Coe heard “She’s Leaving Home,” she didn’t realize she was the subject of a Beatles song. The teenager merely thought the character was like her and a lot of people she knew.

“Years later Paul was on a program talking about how he’d seen a newspaper article and been inspired by it,” Coe recalled. “My mother pieced it all together and called me to say, ‘That song’s about you!’ I can't listen to the song. It’s just too sad for me. My parents died a long time ago and we were never resolved.”