The film's bosses were initially keen to secure Rolling Stones' Keith Richards to play a pirate rocker in the latest instalment of the adventure movie but when he was unable to film the part, the team were thrilled to secure the Beatles star.
Co-director Espen Sandberg said: "So we needed another rocker and on top of our list was Paul McCartney. And Johnny said, 'Well, I have his number.' And of course Johnny has Paul McCartney's number. So he started texting him. And it went back and forth. And then [Paul] said yes. So we were super happy."
Whilst co-director Joachim Ronning added to USA Today: "It was fun. And there we went."
Keith - who was unable to make a cameo in the most recent film due to "touring commitments" - had previously made an appearance as Captain Jack Sparrow's (Johnny Depp) father Captain Teague in 2007's 'Pirates of the Caribbean: At World's End'.
Sir Paul McCartney's involvement in the fifth installment of the pirate franchise was revealed in March 2016 when a source said bosses had approached the musician about the role and directors Ronning and Sandberg had decided to add an extra scene just for him.
Source: Sunday World