(LOS ANGELES) -- On Wednesday night's installment of The Tonight Show with Jay Leno, guest Bill Maher appeared in a tux, and after making some small talk with the outgoing host, he interrupted the chat to announce he'd cooked up a surprise for Leno.
Maher told Leno, "When Johnny Carson was leaving, Bette Midler famously came out and sang for him, and I thought you deserved no less. So I called up Bette Midler-- she would not take my calls."
Instead, the HBO chat show host said he found someone "who's every bit as good a singer as Bette," Family Guy creator Seth MacFarlane. Together, the pair sang "Thanks for the Memories" to Leno, changing the lyrics to reflect Leno's time at the Tonight Show including lines like, "The rivalry with Dave/The beating that you gave/You crushed him at the ratings and you'll take that to your grave..." and "You've been fired/And twice retired for being Number One/How stupid they were."
Leno's last Tonight Show will be Feb. 6 -- but his two pals who serenaded him doubted he'll be off TV for very long.
"We bet our socks/You'll end up on Fox," the tuxedoed pair sang.
Copyright 2014 ABC News Radio