Rainn Wilson has been cast in a lead role in the upcoming Amazon series “Utopia.”

Based on the British series of the same name created by Dennis Kelly, “Utopia” follows group of young adults who meet online and are mercilessly hunted by a shadowy deep state organization after they come in to possession of a near mythical cult underground graphic novel. They discover the conspiracy theories in the comic’s pages may actually be real and are forced in to the dangerous, unique and ironic position of saving the world.

Wilson will play Michael Stearns. Once a promising virologist, Michael is now a forgotten scientist who’s lost his edge—under-appreciated and underfunded in his laboratory work. When a nationwide outbreak of a deadly flu arises, Michael offers his expertise, and soon finds he has landed smack in the middle of something much bigger.

Wilson joins previously announced cast member Sasha Lane, who will play Jessica Hyde.

Wilson is best known for his role as Dwight Schrute on the acclaimed NBC series “The Office,” which was itself an adaptation of a British series of the same name. He also recently took on the role of Harry Mudd in “Star Trek: Discovery” and appeared in the summer blockbuster “Meg.” He will next be seen in the indie film “Blackbird” opposite Kate Winslet and Susan Sarandon.

He is repped by UTA, Odenkirk Provissiero Entertainment, and Sloane Offer.

Amazon ordered a nine-episode first season of “Utopia” back in April. The original series aired two six-episode seasons on Britain’s Channel 4 between 2013 and 2014.

The series is a co-production between Endemol Shine North America and Kudos, an Endemol Shine Group UK production studio, and Amazon Studios. Gillian Flynn will serve as executive producer and showrunner with Kelly also set to executive produce. Jessica Rhoades, who collaborated with Flynn on “Sharp Objects,” will also executive produce along with Sharon Hall, Karen Wilson, and Diederick Santer. Sharon Levy, president of unscripted and scripted television for Endemol Shine North America, will oversee production for Endemol Shine.