Rainn Wilson, best known for playing Dwight Schrute on The Office, will guest-star on Star Trek: Discovery as a fan-favorite character from the original series, CBS announced Friday.

Wilson will play Harcourt Fenton Mudd — better known as Harry Mudd — a charismatic intergalactic con man who acted as a comic foil to William Shatner's Captain Kirk on the original series; and will do the same with Jason Isaacs's Captain Lorca on Discovery.

Mudd first appeared in two episodes of the original series, where he was played by Roger C. Carmel. He's a roguish criminal with the gift of gab and a handlebar mustache (whether Wilson keeps the mustache remains to be seen). He once talked his way into becoming the ruler of a planet of androids. He's the only non-crew character to appear in more than one episode of the original series. Since those appearances, his mythos has been deepened in Star Trek comics and novels.

Rainn WilsonRainn Wilson

Wilson's first film role was in the Star Trek parody Galaxy Quest, so appearing in an official Star Trek property kind of brings his career full circle.

Wilson is the first major guest star announced for Star Trek: Discovery. The main cast includes Jason Isaacs, Sonequa Martin-Green, Michelle Yeoh, Anthony Rapp, Doug Jones and James Frain.

Star Trek: Discovery will premiere later this year on CBS. All episodes after that will be exclusively available on CBS All Access, CBS' on-demand streaming platform.

(Full disclosure: TVGuide.com is owned by CBS.)