The Beatles have released what is being described as their final new song together, entitled Now and Then.

It completes a series of Lennon-penned songs handed in demo form to Paul McCartney in 1994 by Yoko Ono, with “For Paul” written on the cassette. McCartney and the remaining Beatles created two new songs from the recordings, Free As a Bird and Real Love – each was a Top 5 hit in the UK, with Free As a Bird reaching No 2 in December 1995 and Real Love at No 4 in March 1996.

But the band struggled to complete a song from the demo of Now and Then, and abandoned their attempt. Now, enabled by AI technology that has better isolated John Lennon’s vocal from the demo, the song has finally been completed. McCartney and Ringo Starr recorded new parts for it, while the late George Harrison features via guitar parts kept from that shelved 1995 session.

A making-of film was released on Wednesday, which doesn’t feature the song itself. Referring to Lennon, Starr says in the film: “It was the closest we’ll ever come to having him back in the room.”

McCartney explained the difficulties the band faced in 1995: “On John’s demo tape, the piano was a little hard to hear. And in those days, of course, we didn’t have the technology to do the separation … we kind of ran out of steam a bit, and time. Now and Then just languished in a cupboard.”

He said he had some doubts about making full songs out of Lennon’s demos, out of respect for the late songwriter’s unfinished work: “Is it something we shouldn’t do? Every time I thought like that I thought, wait a minute, let’s say I had a chance to ask John: ‘Hey John, would you like us to finish this last song of yours?’ I’m telling you, I know the answer would have been: ‘Yeah!’”

Peter Jackson directed the music video for Now and Then – launching at 2pm GMT on Friday – having directed the eight-hour Get Back documentary, which also utilised the same AI technology to show how the band pieced together songs for their final two albums, Abbey Road and Let It Be.

Liam Gallagher appeared to have had an early listen to Now and Then, writing on X on Thursday morning: “Absolutely incredible biblical celestial heartbreaking and heartwarming all at the same time.” When asked by a fan if he was worried he wouldn’t like the song, Gallagher replied: “The Beatles could shit in my handbag and I’d still hide my polo mints in there.”