The 'last Beatles song' written by John Lennon and finished by the last two surviving members of the band will be released next month.

Titled 'Now and Then' the song was written was written more than 40 years ago and worked on by Lennon, George Harrison, Paul McCartney and Ringo Starr.

The song dates back to 1978 and was one of several demos on a compilation labelled 'for Paul' given to McCartney by Lennon's widow Yoko Ono after his death.

It was largely recorded on to a boombox as Lennon sat at a piano in his New York apartment and has remained unreleased until now but will now see the light of day on November 2.

McCartney and Starr have finished the demo of the song and will release what is being billed as "the last Beatles song".

The Liverpool four-piece are one of the most successful and influential bands in the history of popular music, having sold over 600million records worldwide.

'Now And Then' will be released worldwide at 2pm GMT / 10am EDT / 7am PDT on Thursday, November 2 by Apple Corps Ltd./Capitol/UMe.

The double A-side single pairs the last Beatles song with the first: the band’s 1962 debut UK single, 'Love Me Do'.

Both songs are mixed in stereo and Dolby Atmos, and the release features original cover art by renowned artist Ed Ruscha.

The new music video for “Now And Then” will debut on Friday, November 3. More details including global premiere plans will be announced.

Read More: The Beatles 'Love Me Do' at 60 and their Scottish legacy

Led by the songwriting partnership of Lennon and McCartney, The Beatles released 'Love Me Do' in 1962 and soon became the biggest band on the planet.

At the height of what became known as 'Beatlemania' over 70 million people tuned in to watch the 'Fab Four' on The Ed Sullivan Show, and in 1965 they set records by playing to 55,000 people at Shea Stadium in New York.

Lennon declared at the time the group were "bigger than Jesus", sparking a backlash from conservative Christian groups and following the tour to promote Revolver they became a studio-only band.

The Herald: The Beatles: Get Back

They nonetheless only grew in terms of popularity and critical standing, releasing revered albums Sergeant Pepper's Lonely Hearts Club Band, Abbey Road and the self-titled LP known as The White Album.

Though Let It Be was their final album, most of it was recorded before the Abbey Road sessions which proved difficult and ultimately led to the break-up of the band at the end of 1970.

All four of the members went on to various degrees of solo success, McCartney with Wings and Lennon with the Plastic Ono Band.

Starr and Harrison also had successful solo careers but while they were offered up to $50m to reunite the band would never play together again.

Read More: A Life in Songs: The tracks that made The Beatles

Lennon was shot and killed outside of his New York apartment by a crazed fan called Mark Chapman on December 8, 1980 and Harrison died due to lung cancer in 2001.

McCartney revealed earlier this year that new technology had enabled the two surviving members of the band to complete an old demo.

Two of the songs from the 'for Paul' tapes, 'Free As A Bird' and 'Real Love', had previously been released as part of an anthology.

McCartney, Starr and Harrison had worked on 'Now and Then' but shelved it after Harrison dubbed it "f*****g rubbish".

After working with director Peter Jackson on the Get Back documentary though, the two surviving members realised AI technology could be used to finish the song.

The series' dialogue editor had built a custom AI to separate out the band members' voices from footage and audio of the time, as well as remove background noise.

McCartney told the BBC in April: "We had John’s voice and a piano and he could separate them with AI. They tell the machine: ‘That’s the voice. This is a guitar. Lose the guitar'.

"So when we came to make what will be the last Beatles record, it was a demo that John had and we were able to take John’s voice and get it pure through this AI. Then we can mix the record, as you would normally do. So it gives you some sort of leeway.”