Get the latest from TODAY

Sign up for our newsletter
 / Updated 
By Maria Elena Fernandez and Kurt Schlosser

David Letterman, the longest-serving late-night talk show host in TV history, announced during a taping for Thursday's "Late Show" that he will retire from the CBS program next year when his contract expires. His production company, Worldwide Pants, confirmed the news in a statement.

"The man who owns this network, Leslie Moonves, he and I have had a relationship for years and years and years, and we have had this conversation in the past, and we agreed that we would work together on this circumstance and the timing of this circumstance," Letterman told his audience at New York's Ed Sullivan Theater. "And I phoned him just before the program, and I said 'Leslie, it's been great, you've been great, and the network has been great, but I'm retiring.'

"I just want to reiterate my thanks for the support from the network, all of the people who have worked here, all of the people in the theater, all the people on the staff, everybody at home, thank you very much," Letterman said. "What this means now, is that Paul and I can be married.

"We don't have the timetable for this precisely down," Letterman said. "I think it will be at least a year or so, but sometime in the not too distant future, 2015 for the love of God, in fact, Paul and I will be wrapping things up." The audience gave him a standing ovation.

Initial word of the retirement spread furiously on Twitter after two of the musicians performing on Thursday night's show shared that Letterman had made the announcement.

Former R.E.M. bassist Mike Mills and musician Joseph Arthur, whose Lou Reed tribute album will be released in May, tweeted the unexpected news. Mills and Arthur were slated to perform with R.E.M. co-founder and guitarist Peter Buck.

Mills spoke backstage about breaking the news by being in the "right place, right time."

People who were in the audience Thursday told TODAY they thought the host was joking from behind his desk.

“I was waiting for the punchline — where’s the joke?” said Kassandra Perez-Desir, 32, a lawyer from Brooklyn.

“It was all in a joke form," said Jen Piazza, 32, a video editor who is also from Brooklyn. "We were hoping he was kidding. I’m pretty devastated. He’s the reason I wanted to work in TV 20 years ago." Piazza added that she hadn't been to a show taping in eight years and said it was "crazy" to have been on this particular night.

Letterman, 66, has been a late night mainstay since 1982 when his show "Late Night with David Letterman" debuted on NBC. After Johnny Carson retired and Letterman was passed up for "The Tonight Show" gig, he left for CBS to host the "Late Show with David Letterman." He has been taping that show at the historic Ed Sullivan Theater since Aug. 30, 1993.

Moonves, the president and CEO of CBS, released a statement Thursday about his network's longtime funnyman:

"When Dave decided on a one-year extension for his most recent contract, we knew this day was getting closer, but that doesn’t make the moment any less poignant for us. For 21 years, David Letterman has graced our Network’s air in late night with wit, gravitas and brilliance unique in the history of our medium. During that time, Dave has given television audiences thousands of hours of comedic entertainment, the sharpest interviews in late night, and brilliant moments of candor and perspective around national events. He’s also managed to keep many celebrities, politicians and executives on their toes - including me. There is only one David Letterman. His greatness will always be remembered here, and he will certainly sit among the pantheon of this business. On a personal note, it’s been a privilege to get to know Dave and to enjoy a terrific relationship. It’s going to be tough to say goodbye. Fortunately, we won’t have to do that for another year or so. Until then, we look forward to celebrating Dave’s remarkable show and incredible talents."

Fellow comedians and talk hosts Jimmy Kimmel and Ellen DeGeneres were among those reacting on Twitter.

New "Tonight Show" host Jimmy Fallon said in a statement, "Dave's the greatest. One of the true innovators in TV history. He's made all of us better."

Callum Grey, a 22-year-old student from Norwich, England, told TODAY outside the theater that Letterman's departure will be "a big loss for American TV. A big hole to fill."

— TODAY's Sarah Bourassa contributed to this report