Getting shafted by NBC was the best thing that ever happened to Conan O'Brien, the brand.

One minute the 6-foot-4 redheaded comic was leading The Tonight Show to its worst ratings ever. The next he was a late-night martyr and hero to the tweeting masses, exiting broadcast TV with principles intact and an "et tu, Leno?" knife in his back.

O'Brien isn't allowed to perform on TV or online until fall by contractual agreement with NBC, which gave him a $32 million handshake and "sent my skinny Irish ass out the door" - as he sang in a reworked take of Gloria Gaynor (and Cake's) "I Will Survive" at the Borgata Hotel & Casino in Atlantic City on Sunday.

When the time comes, O'Brien will launch a new talk show on cable channel TBS, scheduled to premiere Nov. 8. In the meantime, he's taken his show directly to his peeps, Team Coco, with the Legally Prohibited From Being Funny on Television Tour, a 32-city trek that included two Borgata shows and arrives at the Tower Theater in Upper Darby on June 7.

At the sold-out early show on Sunday, O'Brien was bearded, untucked, and more relaxed than he ever appeared on late night as he served as ringmaster of a frequently hysterical variety show.

Time in the spotlight was shared with Legally Prohibited band members Richie "La Bamba" Rosenberg and Mark "Love Man" Pender, former Tonight Show writer Deon Cole (whose stand-up interlude was a standout), and sidekick Andy Richter.

Foulmouthed puppet Triumph the Insult Comic Dog was, presumably for legal reasons, instead self-identified as "Triumph the Only Dog in America Who Hasn't Been Banged by Jesse James and Tiger Woods." The Masturbating Bear, alas, did not show, but an inflatable prop that O'Brien claimed was the bat from Meat Loaf's Bat Out of Hell tour made multiple appearances.

And from a taped opening segment that showed a ridiculously overweight O'Brien feeding his dog peanut butter with his toes to the tune of Eric Carmen's "All by Myself," to a monologue in which he explained how he didn't fit in Atlantic City because "I don't gamble and I don't like going around in a fitted T-shirt with a sequined leopard on the sleeve," the spindly legged O'Brien was quite often, like TBS's marketing slogan, "very funny."

Throughout the 100-minute evening, O'Brien drew on his dismissal from NBC for narrative continuity, reminding the young-for-a-casino-showroom cuckoo-for-Coco crowd that his maiden tour marked "the first time in my career anyone has ever paid to see me.

"They've only paid to make me go away."

One particularly rich bit explored the eight steps to recovery for fired talk-show hosts. Mandatory stages include "Denial," "Anger," and "Buying Everything Amazon Says I Would Also Like."

The show never played like a pathetic pity party, however. That was partly because O'Brien was so relentlessly self-deprecating. He described his new hirsute look as making him look like "Paul Bunyan with an eating disorder" or perhaps "Brawny the paper towel guy before his bone marrow transplant."

The first half of the show was gut-busting, expertly paced, and sharply written. The back end lost focus as it relied on musical numbers, with O'Brien strapping on an electric guitar. In some cases, songs got amusing comic rewrites (Willie Nelson's "On the Road Again" explored various indignities O'Brien would suffer through to "have my own show again"). Others, such as the Stray Cats' "Rock This Town," were played straight with merely agreeable results.

That was more than OK with a crowd happy to see its hero so loosened up. And witnessing O'Brien indulge his musical jones was a small price to pay for so many rare in-the-flesh yuks.

O'Brien got a raw deal from NBC, but his sophomoric absurdist humor never sat comfortably on the middle-America-targeted Tonight Show mantel. The best thing about The Legally Prohibited From Being Funny on Television tour is that it suggests that when cable liberates him from the pressure to cater to the mainstream, he'll be funny on TV once again.

Additional performance.

8 p.m. Monday at the Tower Theater, 69th and Ludlow Streets, Upper Darby. Tickets: $39.50-$79.50. Information: 610-352-2887, 1-877-598-8497; www.livenation.com.
Contact music critic Dan DeLuca at 215-854-5628 or ddeluca@phillynews.com. Read his blog, "In the Mix" at www.philly.com/philly/blogs/inthemix/.