John Fogerty stopped by The Late Show With David Letterman yesterday, performing a three-song medley of hits as his way of saying farewell to the late-night TV legend.

Letterman will step away from the Late Show desk on May 20, ending a distinguished career that started more than 30 years ago on the set of NBC's Late Night With David Letterman. He departed the network in 1993, premiering The Late Show in August of that year on CBS, where he's presided ever since.

Fogerty and Letterman go way back — Letterman challenged Fogerty to appear on Late Night in 1986, the same year Fogerty inducted Buddy Holly into the Rock and Roll Hall of Fame and performed "Proud Mary" during an all-star jam that included members of Letterman's house band, led by Paul Shaffer. In more recent years, Fogerty played multiple Late Show episodes in support of his 2013 album Wrote a Song for Everyone.

You can check out Fogerty's performance from last night -- which includes "Travelin' Band," "Proud Mary" and "Fortunate Son" -- above. He remains on the road playing dates on his '1969' tour, and has announced an October publication date for his upcoming memoir, Fortunate Son: My Life, My Music.

When Fogerty sets out to promote the book, he may stop by a Late Show with a whole new look: Letterman's replacement, Stephen Colbert, is set to take over in September.

See Creedence Clearwater Revival and Other Rockers in the Top 100 Albums of the '70s

Rock's Nastiest Feuds

More From Ultimate Classic Rock