The band, as the former 'Late Show' host explained during his final show Wednesday night, went to New York after being on tour in South America to play Letterman's favorite song on his first show back after having open-heart surgery.

The Foo Fighters helped David Letterman bid farewell to his 33-year late-night career on Wednesday night, but the band also delivered a memorable performance of their hit "Everlong" on Letterman's first show back after having open-heart surgery in 2000.

As Letterman explained Wednesday night, when he returned to The Late Show after the procedure, one of his requests for his first show back was to have the Foo Fighters perform "Everlong," explaining that the song was "special to me. It [was] meaningful during my heart recovery. It would be just great."

When Letterman's people asked the band, they were on tour in South America, but that turned out not to be a problem.

"I said, 'Oh, darn,'" Letterman recalled when he learned that the band was on tour, but he was told, "That's all right. They canceled the tour. They are coming back to do the show. And they are doing the song that you asked for."

"Ladies and gentlemen, happily, ever since, we've been joined at the hip," he added.

Letterman introduced the group's performance on that earlier show, which aired on Feb. 21, 2000, by saying, "my favorite band playing my favorite song."

During that performance 15 years ago, frontman Dave Grohl interrupted the lyrics to shout out Letterman's band leader Paul Shaffer, who was accompanying them on keyboards, and to say, "Welcome back, Dave."

"Everlong's" role in Letterman's farewell has likely helped boost sales of the song on iTunes, where as of Thursday afternoon, it was the No. 78 most downloaded song.

Watch the vintage performance in the video below.