Receive the latest television updates in your inbox

The most recent episode of "Louie" ended with writer, director and star Louis CK standing on Broadway in front of the Ed Sullivan Theater, smiling and thrusting his arms in the air, “Rocky”-style, celebrating a victory only he could appreciate. “I did it!” he cried.

The scene capped an extraordinary three-episode arc in which Louie is semi-secretly groomed as possible replacement for a supposedly retiring David Letterman. Louie overcomes a crisis of confidence and his own ambivalence about success to kill in a test show – only to learn he was a pawn in CBS-Letterman contract negotiations.

Still, Louie smiles – the happiest he's ever allowed us to see him in a show usually propelled by his low-grade depression. With the triumphant third season of “Louie” headed to a close Thursday, the comic gleefully proved himself to his most importance audience: Louis CK.

CK entered the season coming off critical accolades and awards that, at least to him, signaled he was due for a fall (“This is stupid, now,” he said after getting his fourth trophy of the night at The Comedy Awards in April. “I hate this, now, I hate this. It’s like a f------ nightmare to keep getting this f------ thing over and over again”). He won a comedy writing Emmy for his FX show Sunday, no doubt adding to his angst.

In Memoriam

Still, this season emerged as his strongest and most mature while maintaining the blunt humor and wild unpredictability that marked his previous outings. An infusion of guest stars often can be a sign of a show on borrowed time. But “Louie” only became stronger by sharing the TV stage with the likes of Sarah Silverman, Marc Maron and “Twin Peaks” director David Lynch as a demented Mr. Miyagi of TV comedy.

Robin Williams showed he's still capable of comic subtly, playing a non-mourner at a funeral of a man hated by his character and Louie. Parker Posey shined and frightened as a flakey, demon-filled, would-be girlfriend who literally drove Louie to the edge. Melissa Leo shocked in a profanity-and-violence-laden sex scene we're still struggling to process. F. Murray Abraham made us squirm as Louie's slick, domineering uncle who commands the comic to visit his estranged father (Louie makes it as far as the front door before embarking on a surreal escape out of a Bond flick).

The Letterman arc also gave us Jay Leno, Chris Rock and Jerry Seinfeld boldly playing unflattering versions of themselves as show-biz backstabbers. In the end, not only does Louie lose the Letterman slot, but gets banned from "Late Show" – somewhat mirroring CK’s real-life history with Letterman. Before appearing on the show last year for the first time in 15 years, CK, a former Letterman writer, told Esquire he believed he’d been barred from the program.

It’s doubtful CK will get back in the Ed Sullivan Theater anytime soon, considering he yelled, “F--- you, Letterman!” outside the building in last week’s episode. He probably doesn’t care. Louis CK wins by playing by his own rules, which means he also gets to declare the terms of victory. He makes a show he wants to see, ensuring he gets the last laugh.