Now that Showtime’s “The Affair” has come to a close after five seasons, co-creator and showrunner Sarah Treem has signed a multi-year overall deal with Fox 21 Television Studios to create, develop, producer and oversee series for network, cable and streaming platforms.

“I have wanted to work with Sarah for a long time, and leapt at the chance as soon as ‘The Affair,’ which I loved, ended,” said Fox 21 president Bert Salke. “There are very few creators who have her muscular sense of story and her gift for building unique and idiosyncratic characters. On top of all that she’s a great showrunner and has great taste. And she’s cool.”

Treem, who came up in theater, previously wrote for and co-executive produced David Fincher’s “House of Cards” for Netflix, in addition writing all three seasons of HBO’s “In Treatment.” She currently has an untitled Hedy Lamarr limited series set at Showtime, starring Gal Gadot, which Treem will write, showrun and produce alongside Warren Littlefield, Katie Robbins, Gadot and Jaron Varsano. Littlefield signed a pod deal at Fox 21 a year ago.

“I’m really honored and excited to be joining Bert, Dana and Craig at Fox 21,” said Treem. “I’m so grateful they’re choosing to invest in the kinds of stories I want to tell and I can’t wait to get going.”