Neil Gaiman and Akiva Goldsman will adapt Mervyn Peake’s Gormenghast books into a television series for FremantleMedia North America. The rights to the five-book series were reportedly hotly contested, with FremantleMedia finally winning out in the end.

The Gormenghast series follows the schemes and machinations of various castle attendants and their lords, all of whom live in Gormenghast Castle, a sprawling, medieval structure as big as a city. Peake originally wrote three novels in the series -- Titus Groan (1946), Gormenghast (1950) and Titus Alone (1959) -- before his death in 1968. Included in the deal is also Boy in Darkness (1956), a novella by Peake, and Titus Awakes, a posthumously published novel completed and published by Peake’s widow in 2009.

RELATED: DC Comics, Neil Gaiman Announce The Sandman Universe Imprint

“There is nothing in literature like Mervyn Peake’s remarkable Gormenghast novels,” Gaiman said in a press release sent to Deadline. “They were crafted by a master, who was also an artist, and they take us to an ancient castle as big as a city, with heroes and villains and people larger than life that are impossible to forget. There is a reason why there were two trilogies that lovers of the fantasy genre embraced in the Sixties: Lord of the Rings, and the Gormenghast books. It’s an honor to have been given the opportunity to help shepherd Peake’s brilliant and singular vision to the screen.”

Gaiman is best known for his work on the Sandman comic book series and as an executive producer on the Starz adaptation of his novel American Gods. Goldsman won an Academy Award for Best Adapted Screenplay for 2001’s A Beautiful Mind, whose screenwriting credits include the likes of Batman Forever, Batman & Robin, I Am Legend and Cinderella Man, among others.