It’s the first time since 2010 that the Fab Four rhythm section worked together. Their last collaboration was on the tracks “Peace Dream” and “Walk With You” on the drummer’s album Y Not.

Details of McCartney’s contribution to Starr’s upcoming 19th LP have not been revealed. But the drummer posted a picture of the pair on Twitter and said: “Thanks for coming over and playing great bass. I love you man peace and love.”

A second picture included the comment: “And look Joe W. came out to play what a day I’m having peace and love.”

Producer Bruce Sugar released an image of himself with the ex Beatles and wrote: “Magical day in the studio with these two.”

Starr reported in 2015 that he’d learned to deal with Walsh while they collaborated on his 18th album Postcards From Paradise. The drummer said: “I tell Joe, when he’s done a solo, that’s it. He wants to do it, and do it, and do it. That’s how he is – but I’ve known him long enough to say, ‘No. We’ve got it.’”

Discussing how he’d talked Walsh into playing a solo for the title track, Starr joked: “Joe’s a brother-in-law now. He can’t refuse.”

He also revealed in the past week that his next record will also feature guest appearances by the Eagles’ Timothy B Schmit, Richard Page of Mr Mister, Benmont Tench of the Heartbreakers, Nathan East and Amy Keys.