'The Office' Finale: Which Former Stars Returned

The Office John Krasinski Isla Fischer - H 2012

The Office John Krasinski Isla Fischer - H 2012

[Warning: Spoilers ahead if you haven't seen Thursday night's The Office.]

Steve Carell made a surprise return to The Office on the series finale.

The actor, who played Michael Scott for seven of the NBC comedy's nine seasons, reprised his character in Thursday night's episode to make a surprise appearance at the wedding of Dwight (Rainn Wilson) and Angela (Angela Kinsey).

PHOTOS: Inside 'The Office': The Stars Look Back on 9 Seasons of Dunder Mifflin

Jim (John Krasinski) was set to be Dwight's best man -- or "bestest mensch," in Schrute vernacular -- but played a prank on Dwight, in which he said the best man was supposed to be someone older and he wasn't going to be able to perform the duties.

Dwight turned around to find Michael standing in the doorway.

Said Dwight, "I can't believe you came."

Replied Michael, "That's what she said."

Michael later told the cameras of his former co-workers: "I feel like all my kids grew up and then they married each other. It's every parent's dream."

Mindy Kaling and B.J. Novak also reprised their characters -- on-again/off-again couple Kelly and Ryan on the finale (they left "on again"). Carell's wife, Nancy, also made a cameo as her realtor character Carol, Scott's ex-girlfriend.

EXCLUSIVE VIDEO: 'The Office' Series Finale: Stars Break Down During Emotional Farewell

However, Scott's wife Holly, played by Amy Ryan, didn't appear on the episode, but it was revealed they have kids together -- and he's had to buy two phones to hold all the pictures he's taken of them.

Other past co-stars who also didn't return included Jan (Melora Hardin) and Roy (David Denman).