Sir Paul McCartney has announced his first UK shows in three years including one gig marking the 50th anniversary of one of his most famous tunes.

The former Beatle will play London’s O2, Birmingham and Liverpool in May as part of a European tour.

The O2 show will take place 50 years after he finished writing his classic track Yesterday.

Paul McCartney plays the piano during his Valentine's show
Paul McCartney will tour the UK in May (Evan Agostini/AP/PA)

The song, which was originally released on the 1965 album Help!, is reported to have come to Sir Paul in a dream and was originally known as Scrambled Eggs before he wrote the final lyrics.

Sir Paul said: “I’m often never aware of these anniversaries until someone points it out. People always say to me ‘hey, did you know it was 30 years since this and 30 years since that’, so it’s impossible to stay on top of it all. But I never need an excuse to celebrate so it’s always nice to hear!

“For me it’s a happy coincidence that The O2 show falls at this time. It’s great that people all over the world reacted so well to the song, it’s all you can hope for! It feels like it has taken on a life of its own over the years.

“The song still is and always has been an important part of our live show.

The former Beatle will perform in his home town of Liverpool (PA)
The former Beatle will perform in his home town of Liverpool (PA)

“It’s always very emotional for me to hear crowds singing it so loudly at my concerts and I’m looking forward to singing it along with the audience at the O2 in May.”

The set list will include tracks from throughout his career including songs from his most recent album – 2013′s New.

The gigs will be his first UK concerts since he played the Royal Albert Hall in 2012.

Tickets go on sale on Monday at 10am.