FX has ordered the limited series “A Teacher,” based on the Hannah Fidell film of the same name.

The series explores the story behind the mugshot of a female high school teacher, Claire (Mara), caught in an affair with her male student, Eric (Robinson), revealing the complexities and consequences of these illegal relationships. FX has ordered 10 episodes.

“Working with FX – truly the home of all my favorite shows – on ‘A Teacher’ is a dream come true,” said Fidell. “I couldn’t ask for a more perfect partner who, from day one, has understood and embraced the inherenent complexities and nuance required for such subject matter.”

The film version of “A Teacher” — which Fidell wrote, produced, directed — was released in 2013, making its debut at the Sundance Film Festival. Fidell will also write and direct the series in addition to serving as an executive producer alongside Mara, Michael Costigan and Jason Bateman of Aggregate Films, and Danny Brocklehurst. FX Productions will produce.

“Hannah Fidell is an exceptional filmmaker we have long admired for her intuitive ability to bring complex stories to life with depth and grace,” said Gina Balian, co-president of original programming for FX Entertainment. “We are thrilled to partner with Hannah, Kate Mara, Michael Costigan, Jason Bateman and Danny Brocklehurst to adapt A Teacher into a limited series for FX, with Kate leading an extraordinary cast along with Nick Robinson.”

Mara recently appeared in the first season of the FX shows “Pose” and “American Horror Story. She also previously starred in the first season of the Netflix series “House of Cards.” Her film credits include “The Martian,” “Fantastic Four,” “127 Hours,” and “Shooter.”  She is repped by WME, Mosaic, and Sloane Offer

Robinson recently starred in the critically-acclaimed film “Love, Simon” in the title role. His other film credits include “Jurassic World” and “The Kings of Summer.” On the TV side, he was a series regular on the ABC Family (now Freeform) series “Melissa & Joey.”

He is repped by UTA, Management 360, and Felker Toczek.