Actor Jason Segel has signed a three-book deal with Random house for a series of children’s books.

The How I Met You Mother star’s series, Nightmares!, tells the story or a group of friends who must save their neighbourhood from fear, says The Hollywood Reporter.

Segel said in a statement "Ultimately, it’s a story about learning that we can accomplish anything, as long as we are brave enough to try."

Speaking a few weeks ago about the project Segel said the idea originally started as a screenplay which he sold before his acting career took off. After eight years he bought it back for the same amount he sold it for

Children’s author Kirsten Miller is set to co-write the books with the actor. The first novel in the trilogy will be published next year.