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 US presidents, Hollywood stars and devoted fans.

The last-ever "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. and George W. Bush and Bill Clinton, as well as current president Barack Obama were filmed repeating one after the other, "our long national nightmare is over."

"Letterman is retiring," said 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 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 celebrity and play-back highlights of years gone by.

Hollywood stars Alec Baldwin, Steve Martin, Bill Murray and Jim Carrey, and comedians 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 humor of the veteran broadcaster, the longest-serving nighttime 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 Theater in New York.

Critics have praised Letterman for combining innovative and odd-ball antics with traditional interviews, and for inspiring some of most the talented comics working today in Britain and the United States.


Stand-out moments


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.

Sarcastic, at times angry and scathing, some celebrities admitted they feared him, and ended up in his crosshairs.

Singer Cher once quipped on air that she thought he was an "asshole" and yet he enjoyed an on-camera chemistry with many guests.

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.

Other stand-out moments also set him apart.

After the horror of the September 11, 2001 attacks on the United States, Letterman was the first comedian to go back on air -- six days after the Al-Qaeda hijackings that killed some 3,000 people.

In January 2000, he underwent a quintuple heart bypass. Five weeks later, he was back on air with his doctors as his guests.

In 2009, he admitted to affairs with female staffers and apologized on air, alongside his wife and his team. He kept his job.

In a nod to the past, Letterman quipped Wednesday that next time he screws up "I'll have to go on someone else's show to apologize."

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.