CBS has inked contract extensions with David Letterman and Craig Ferguson, keeping them on the network through 2014.

Pact will put Letterman in the record books for the longest stint as a late-night TV host, surpassing Johnny Carson’s 30-year run on NBC’s “Tonight Show.”

“Late Night with David Letterman” began on NBC in 1982, switching over to CBS in 1993.

“David Letterman is a late night legend with an iconic show and Craig Ferguson continues to evolve the genre in exciting and innovative ways,” said Nina Tassler, president of CBS Entertainment.

The new deal will also establish CBS as a co-producer of Ferguson’s “The Late Late Show” along with Letterman’s shingle, Worldwide Pants. In addition, Ferguson’s show is moving to a larger stage at the Eye’s Television City digs, where it has been since its inception in 2005.

Though there had been rumors speculating that Letterman was mulling retirement, the CBS announcement makes no mention of an end date for his program. Nor is there any succession plan in place for when Letterman does exit, conceivably setting up Ferguson as an heir to the 11:35 p.m. throne.

Letterman’s current two-year deal, which was to end in August, was signed in 2010.

The new pact ensures the continuation of one of TV’s greatest rivalries, pitting Letterman against the man who replaced him at NBC, Jay Leno. While the “Tonight” host has outdueled Letterman in the ratings for most of their careers, the CBS host scored rare victory last November, beating Leno in the 18-49 ratings for the first time in 18 years.

Financial terms of the deal were not disclosed, but the extensions likely mean raises for both Letterman, who is already late night’s richest man pulling down an estimated $28 million per year, and Ferguson, who is said to be making in the neighborhood of $13 million.