At the beginning of ABC’s latest “Live in Front of a Studio Audience” special on Tuesday night, in which celebrities reenacted episodes of classic sitcoms, executive producer and late-night host Jimmy Kimmel offered a reminder for the audience: “The show is live,” he said. “If it goes off the rails, it goes off the rails.”

And yet … things did not go off the rails. A group of A-list stars joined together to perform two episodes of “The Facts of Life” and “Diff’rent Strokes,” which both debuted in the late 1970s — and for the most part, all went smoothly. If you missed it, here were some of the highlights from the 90-minute special.

There were several surprise guests.

ABC confirmed the celebrity participants last week, announcing that the cast for “The Facts of Life” would include Jennifer Aniston as Blair; Gabrielle Union as Tootie; Kathryn Hahn as Jo; Allison Tolman as Natalie; and Ann Dowd as Mrs. Garrett, the housemother for the Eastland boarding school students.

Mrs. Garrett, of course, was the same character on “Diff’rent Strokes” as the housekeeper, so Dowd was on double-duty alongside Kevin Hart as Arnold; Damon Wayans as Willis; and John Lithgow as Mr. Drummond.

However, producers teased that there would be surprises, such as Jon Stewart in “The Facts of Life” in a “mystery role.” Turns out that Stewart landed the gig as Carl “Rocky” Price, the poor Bates Academy student who can barely talk through his headgear. But the real unexpected appearances came from “Arrested Development” co-stars Will Arnett and Jason Bateman, who played the Bates boys, as well as Snoop Dogg, who made a cameo on “Diff’rent Strokes” as Willis’s friend Vernon.

Some former stars showed up.

One of the biggest cheers from the audience went to Lisa Whelchel, the original Blair, who sang lead vocals on the famously catchy theme song. Kim Fields (Tootie) and Mindy Cohn (Natalie) joined her at the end, though there was no word on the whereabouts of Nancy McKeon (Jo).

When the “Facts of Life” reenactment concluded, the trio spoke briefly with Kimmel. He asked them for a brutally honest review of the show, and Cohn gave a shout out to Charlotte Rae, the original Mrs. Garrett, who died in 2018.

“Honestly, I think Charlotte is toasting Ann Dowd right this very moment,” Cohn said.

Live TV still proved a bit difficult.

Multiple actors tried their best not to crack up, but couldn’t quite get there.

Hahn’s laughter proved contagious early on as they reenacted a Season 3 episode where the girls host a charity event with the Bates boys, and Mrs. Garrett discovers they have a slam book where they write gossip about their peers. At one point, Union read an excerpt: “There’s only one thing wrong with Maggie Ellis: She’s got enough whiskers to make a walrus jealous.” The camera panned back to Mrs. Garrett, who was appalled, and caught Hahn shaking with laughter; Aniston couldn’t help but join in as they both tried to hide their faces.

Union sparked more giggling when she started explaining the boys’ nicknames for Rocky because of his headgear (“Chicken Coop Cheeks, Fence Face, Birdcage Boy”) and Hahn and Tolman cracked up. Near the end, Arnett, Bateman and Stewart came very close to losing it completely when they argued over who would get to go on a date with Blair.

Kevin Hart was committed to playing the role of a child.

Todd Bridges, the original Willis, introduced the “Diff’rent Strokes” episode and paid tribute to the late actors that starred as his little brother, Arnold (Gary Coleman); TV dad, Mr. Drummond (Conrad Bain); and housekeeper (Rae), as well as Mr. Drummond’s daughter, Kimberly (Dana Plato). And obviously he had to reference Coleman’s infamous catchphrase: “Watchoo talkin’ 'bout, Willis?”

“I want to take this opportunity now to thank you for watching, and to ask you to please, when you see me: Stop asking me what I am talking about!” Bridges joked, to appreciative laughter from the crowd.

Hart really leaned into his role as a small child as they performed a Season 1 episode where Willis finally got fed up with his pesky younger brother. (As Willis pointed out while complaining they still had the same bedtime, “I’m 13, and even though he looks 45, he’s just 8.") In the opening scene, Hart burst into the room doing a somersault as he declared himself “Super Arnold,” and started climbing and doing flips on the bunk bed. This really ticked off Willis, who was just trying to work on a class project with Vernon.

Eventually, Willis snapped at him so much that Arnold was convinced his brother didn’t love him anymore — so Mr. Drummond tried to comfort him, and Hart climbed into Lithgow’s lap. In another impressive move in a different scene, the 76-year-old Lithgow picked up Hart and carried him across the room.

Norman Lear got bleeped.

Norman Lear, whose production company was behind both shows, also served as an executive producer; he and Kimmel kicked off the special, sitting near the studio audience. Kimmel reminded everyone that Lear turns 100 next year, and asked the TV legend what wisdom he could share from 99 years on planet Earth.

“Two words that we don’t think enough about: Over and next,” Lear said. “When something is over, it’s … over.” To emphasize this, he used an expletive, which was immediately bleeped out by some quick-thinking censors.

Kimmel did not look like he was expecting that to happen. “We were worried that, like, Snoop would curse on the air,” he said later. “And sure enough, Norman dropped an f-bomb right at the top of the show.”

More from Arts & Entertainment: