The rumored casting of one of music’s legends in the latest “Pirates of the Caribbean” film has been confirmed.

Paul McCartney has turned in his guitar and piano temporarily to appear in “Pirates of the Caribbean: Dead Men Tell No Tales.”

He made the announcement on his social media accounts with the simple #PiratesLife.

McCartney is walking the pirate footsteps of another rock legend. The Rolling Stones' Keith Richards has appeared in two of the Disney films as the father of Johnny Depp's Captain Jack Sparrow, Rolling Stone reported.

The tweet did not say what role McCartney is playing or whether if it was a fleeting cameo or a more in-depth character.

E! reported that McCartney will portray a jail guard.

Deadline reported last year that McCartney filmed his scene after production ended and is being described as "an extra big set-piece scene."

“Pirates of the Caribbean: Dead Men Tell No Tales” hits theaters on May 26.

McCartney and Depp have paired up multiple times over the past few years.

Depp was featured in two McCartney music videos: 2012's "My Valentine" and 2013's "Queenie Eye."

The former Beatle also recorded with Depp's band Hollywood Vampires. The band is made up of Depp, Alice Cooper, and Joe Perry, Rolling Stone reported.

WATCH: Johnny Depp Visits Disneyland As Captain Jack Sparrow

About the Author

Keep Reading

Janelle James arrives at the 80th Golden Globe Awards at the Beverly Hilton Hotel on Tuesday, Jan. 10, 2023, in Beverly Hills, California. (Robert Gauthier/Los Angeles Times/TNS)

Credit: TNS

Featured

The Juneteenth Atlanta Parade and Music Festival takes place Saturday beginning at The King Center and ending at Piedmont Park. Due to sponsorship difficulties, the event was shortened from three days to two this year. (Jenni Girtman for the AJC)

Credit: Jenni Girtman