Justin Theroux has been cast in a guest starring role in Emma Stone and Jonah Hill’s upcoming Netflix series “Maniac,” Variety has confirmed.

Details on the nature of Theroux’s character are unknown, but the series is a dark comedy based on a Norwegian series. It follows a man who lives a fantasy life in his dreams, but in reality, is locked up at an institution. Both Hill and Stone will play patients in the institution.

Theroux most recently starred in the HBO series “The Leftovers,” which ended its run on the premium cable network after three seasons in June. He has also appeared in the TV shows “Six Feet Under” and “Parks and Recreation.” On the film side, he has appeared in films such as “American Psycho,” “Charlie’s Angels: Full Throttle,” and “The Girl on the Train.” Theroux has also found success as a screenwriter, having worked on the scripts for “Tropic Thunder,” “Iron Man 2,” “Rock of Ages,” and “Zoolander 2.” He is repped by CAA and Lighthouse Management & Media

Hill, Stone and Cary Fukunaga will all serve as exec producers on the series, with Fukunaga also directing. Anonymous Content’s Michael Sugar and Doug Wald will also executive produce, with Ashley Zalta co-executive producing. “Maniac” marks Hill and Stone’s series regular TV debuts, plus their first time producing scripted television. The two first teamed together in 2007 comedy movie “Superbad.” Paramount TV and Anonymous Content will produce.