6th Annual Sean Penn & Friends HAITI RISING Gala Benefiting J/P Haitian Relief Organization - ArrivalsRainn Wilson is going from "The Office" to outer space.

CBS All-Access announced the actor is joining the cast of "Star Trek: Discovery" as space pirate Harry Mudd, an iconic villain from the first season of the original 1960s series.

Mudd is described as a "charismatic conman and intergalactic criminal" who smuggles stolen goods and uses counterfeit currency. In the original series, Mudd was played the late Roger C. Carmel and first appeared in the sixth episode of season 1. He later popped up in the animated series and novels.

Wilson is a self-avowed fan of "Star Trek." In 2015, he tweeted a link to the "Star Trek: Beyond" trailer and gushed:

Since "The Office" left the air in 2013, Wilson has done numerous TV and movie projects, including starring in Fox's short-lived "Backstrom" and appearing in Showtime's "Roadies."

"Star Trek: Discovery" will stream on CBS All-Access some time later this year.

Want more stuff like this? Like us on Facebook.