The song dated back to the early 1970s, when McCartney wrote it during a Swiss skiing holiday.
Originally I had the song from a couple of years ago. I write quite a bit of stuff when I’m on holiday, because I just feel very relaxed, and Linda and I had gone to a place in Switzerland where we were doing a bit of skiing. Well I was trying to do a bit of skiing; Linda was getting pulled around on a rope. She was just learning stuff, you know. One evening in the hotel I just started doing that song, and I always thought of it as something that one day I might give to the Jackson Five or something, you know, because it’s a soul-y type track.
BBC Radio 1, 1978
McCartney first met Jackson in 1975. The following year McCartney played him the song during the wrap party for the Wings Over America Tour in Beverly Hills.
We shook hands amid a huge crowd of people, and he said, ‘You know, I’ve written a song for you.’ I was very surprised and thanked him. And he started singing ‘Girlfriend’ to me at this party. So we exchanged phone numbers and promised to get together soon, but different projects and life just got in the way for both of us and we didn’t talk again for a couple of years. He ended up putting the song on his own album London Town.
Wings recorded their version at Abbey Road on 14 February 1977, with overdubs added during sessions running from 25 October to 1 December.
An orchestral overdub was recorded at AIR Studios sometime between 3 and 14 December. The parts were scored and arranged by Mike Vickers, who had previously worked on The Beatles’ ‘All You Need Is Love’.
Quincy Jones heard the song after the release of London Town. He suggested it to Jackson for Off The Wall, unaware that McCartney had already offered it to the singer.