The legendary musician will play himself in the penultimate episode of season four.

Sir Elton John is headed to Nashville.

The legendary musician is set to appear as himself in an upcoming episode of the ABC country music drama, it was announced Monday.

The "Tiny Dancer" singer will perform alongside up-and-coming singer and songwriter Gunnar (Sam Palladio) in the May 18 episode of the series, which serves as the penultimate episode of season four.

Nashville, which follows several fictional country music stars, has welcomed several real hit-makers in years past, including Brad Paisley, Kellie Pickler, Florida Georgia Line and Sara Evans. Kesha, Kelsea Ballerini and Thomas Rhett are all set to appear as themselves this season.

This is a rare scripted series role for John, who most recently appeared on Lady Gaga's 2013 Christmas special, which also aired on ABC. John released his most recent album, Wonderful Crazy Night, in February. The album was produced by former Nashville executive music producer T-Bone Burnett, who is also married to Nashville creator Callie Khouri.

Nashville airs Wednesdays at 10 p.m. on ABC.