David Letterman’s sign-off from CBS’ “Late Show” next year will not only mark the end of an era in latenight, it will bring the curtain down on one of the most unique and lucrative deals ever crafted for a television star.

From day one on CBS, Letterman has owned “Late Show” outright through his Worldwide Pants production banner. Even in 1993, that was basically unheard of for talent not named Oprah.

But Team Letterman took advantage of a moment in time that gave it the utmost leverage. NBC had been so ham-fisted in its handling of “The Tonight Show” transition in 1991 that it alienated Johnny Carson and Letterman, Carson’s hand-picked successor. That made Letterman a red-hot commodity for a rival network that was desperate to break into the latenight business. Surprisingly, for all its Tiffany successes, CBS had never fostered a latenight franchise to rival NBC — or even ABC’s perch with “Nightline.”

Letterman’s longtime attorney Jim Jackoway and CAA reps Lee Gabler and Steve Lafferty seized the opportunity to command more than just an eight-figure annual payday. Control was crucial to Letterman after the tough experience at NBC.

Worldwide Pants’ 100% ownership of “Late Show” meant that Team Letterman called virtually all of the shots and owned the negatives.

CBS paid Worldwide Pants a license fee just as it would to any other studio — a fee that encompassed the network

picking up Letterman’s considerable salary and production costs. Even Jerry Bruckheimer and Dick Wolf at their peaks never wielded such a club (Mark Burnett comes the closest with his roughly 50% stake in “Survivor”).

Letterman’s deal became even richer about a year into his run on CBS when the network was eager to negotiate a long-term extension. That’s when the two sides hammered out the deal that gave Worldwide Pants ownership and control of the 12:30 a.m. slot following “Late Show.” “The Late Late Show” bowed in January 1995 with Tom Snyder at the helm. Snyder was succeeded in 1999 by Craig Kilborn, who in turn was replaced in 2005 by Craig Ferguson.

Right around this time, Worldwide Pants also was developing a sitcom property with a promising comic, Ray Romano. “Everybody Loves Raymond,” of course, became one of the pillars of CBS’ primetime turnaround, and has made a tidy fortune in syndication.

ABC made a big run at snaring Letterman in 2002, which forced CBS to further plump up its license fee for “Late Show.”

Letterman’s ownership of both of CBS’ latenight offerings came into sharp focus in late 2007-early 2008, during the 100-day writers strike. While “The Tonight Show” and others were sidelined with their writers hoisting picket signs, Worldwide Pants was able to cut an interim agreement that allowed Letterman and Ferguson to go back on air in early January at full strength with all their scribes in tow.

Despite his muscle, Letterman has not been exempt from the changing tides in the TV biz. Declining audience and heightened competition forced a downscaling of the CBS-Worldwide Pants deal in recent years from the 2002 high. And in 2012, CBS quietly came onboard “The Late Late Show” as a co-producer (which translates to an equity interest) as part of a Letterman-Ferguson contract renegotiation. Sources said that move was also prompted in part by a chill in Ferguson’s relations with Worldwide Pants.

Letterman’s business-side reign in late-night will surely end after his retirement. Even if Ferguson’s show continues on CBS, sources close to the situation said it would be unlikely for Worldwide Pants to retain the infrastructure required to produce the show.

Ferguson is negotiating a new contract — with CBS, not Worldwide Pants. Those talks just got a lot more complex, thanks to the April 3 call Letterman made to CBS chief Leslie Moonves.

No matter whom CBS sets its sights on to fill the “Late Show,” there is zero chance the new guy or gal will see anything like Letterman-level largesse. It’s a matter of simple math, and the fact that CBS is no longer in startup mode in the daypart.

On a broader level, when Letterman goes, latenight TV loses the one host who remembered when a single wee-hours personality held the entire nation in thrall. Letterman is TV’s last link to the Johnny Carson era, and the only one who still made an effort once in a while to talk to the nation — not just that sliver of it that represented a particular demographic niche.

Now that’s a passing.

Brian Steinberg contributed to this report.