The Oprah Winfrey Show is to end later this month (May11) and on Tuesday a double-show spectacular was filmed to mark the end of her TV reign.
Foxx kicked off the proceedings by singing Isn't She Lovely to Winfrey, before he was then joined by Stevie Wonder for the rendition.
Meanwhile, funnyman Jerry Seinfeld performed a comedy routine for Surprise Oprah! A Farewell Spectacular.
Other performers included Beyonce and Rascal Flatts, while Josh Groban and Patti LaBelle collaborated on Somewhere Over the Rainbow.
Tom Hanks told a stunned Winfrey, "Your show has turned surprise into an art form. Oprah Winfrey, today you are surrounded by nothing but love. Your studio was not big enough to hold it all, so here we are."
Madonna also paid tribute to the TV titan, saying, "She's a self-made woman who's been at the top of her game for over 25 years - and she's still kicking a**... It's no secret that millions of people are inspired by Oprah. I am one of those people. She fights for things she believes in, even if it makes her unpopular. I have learned so much from her."
Cruise and his wife Katie Holmes, John Legend, Queen Latifah, Halle Berry and Diane Sawyer were also present for the tribute programme.
The double show, which was filmed at Chicago's United Center, will air in America on 23 and 24 May (11), before Winfrey's finale on 25 May (11).