The king of late-night television, David Letterman, brought the curtain down on a 33-year career in an emotional final show packed with jokes and farewells from United States presidents, Hollywood stars and devoted fans.
The last Late Show With David Letterman brings to an end an American cultural institution that has been watched by millions, and an extraordinary career that has inspired a generation of comedians.
Wednesday's finale opened with a bang. Former US presidents George H. W. and George W. Bush and Bill Clinton, as well as current President Barack Obama, were filmed repeating one after another: "Our long national nightmare is over."
"Letterman is retiring," said Mr Obama, standing shoulder to shoulder with the 68-year-old comedian in a pre-filmed segment. "You're just kidding right?" deadpanned Letterman to a no-nonsense shrug from Mr Obama.
It was a night of rapturous applause and standing ovations from a VIP-studded crowd. The show featured gags at Letterman's expense, jokes poking fun at celebrities and highlights of years gone by.
Hollywood stars Alec Baldwin, Steve Martin, Bill Murray, Jim Carrey, Jerry Seinfeld and Tina Fey led 10 stars who performed the bit "Top 10 things I've always wanted to say to Dave".
Their pithy one-liners paid tribute to the caustic and at times grumpy humour of the veteran broadcaster, the longest-serving night-time US talk show host, who has been on air since getting his first show on NBC in 1982.
"Thank you and goodnight," Letterman said at the end of what was the 6,028th television show of his career, calling a multitude of tributes "flattering, embarrassing and gratifying". "Thank you for everything, you've given me everything," he told his fans.
He also gave thanks to wife Regina and their 11-year-old son Harry, who sat beaming in the audience as he said how much he loved them.
Rock giants Foo Fighters played out the show to roars from the jubilant crowd at the Ed Sullivan Theatre in New York.
Critics have praised Letterman for combining innovative and oddball antics with traditional interviews, and for inspiring some of the most talented comics working today in Britain and the US.
Letterman got his first comedy show on NBC, before defecting to CBS in 1993 to host the Late Show after the major career disappointment of losing out to Jay Leno as host of the coveted Tonight Show.
Initially, his ratings eclipsed Leno's on NBC. Then Leno landed an interview with British actor Hugh Grant in 1995, just after he was caught with a prostitute, and Letterman's ratings never caught up.
He was sarcastic, at times angry and scathing. Some celebrities admitted they feared him, and ended up in his crosshairs.
Through it all, Letterman won numerous Emmy awards - the most highly prized accolade in American television - and was nominated dozens of times, including every year from 1984 to 2009.
In September, he will be replaced by Stephen Colbert, 51, to whom he wished nothing but the greatest success.
"I'm very excited. I think he's going to do a wonderful job," he said.