Horror fiction includes some of the best novels being written today.

That's one conclusion to be drawn from the latest Massachusetts Book Awards, which named Paul Tremblay's "A Head Full of Ghosts" the best work of fiction in 2016.

"It was totally unexpected," said Tremblay, who grew up in Beverly and lives in Stoughton. "As a lifelong Massachusetts resident, it means a lot to me. It's also kind of exciting to see a literary award not hold the horror genre against it."

The Massachusetts Book Awards recognize books that are published by residents of the state, or that involve Massachusetts subjects.

"A Head Full of Ghosts" is about a girl from Beverly who is behaving strangely, and could be mentally ill, but also may have been visited by demons.

Published last year, the novel was Tremblay's first. In addition to impressing the judges for the book awards, regardless of its genre, "A Head Full of Ghosts" also caught the attention of the master of horror fiction, Stephen King.

"He tweeted out that 'Head Full of Ghosts' scared the living hell out of him, and he doesn't scare easily," Tremblay said. 

In addition, the novel is being turned into a screenplay by Team Downey, an entertainment company founded by actor Robert Downey Jr.

The Massachusetts Book Awards are administered by the Massachusetts Center for the Book, and are among the most competitive state contests in the country, given the large number of submissions they receive.

The other 2016 award winners are "Rosemary: The Hidden Kennedy Daughter" by Kate Clifford Larson, for nonfiction.

"Immortality," by Alan Feldman, won the 2016 award for poetry, while the winner in the young adult/middle reader category was Ali Benjamin's "The Thing About Jellyfish," and "Ketzel, the Cat who Composed" by Leslea Newman received the award for top picture book.

Tremblay, who teaches math at St. Sebastian's School in Needham, published his second novel this summer, "Disappearance at Devil's Rock," which shares several characteristics with "Head Full of Ghosts." 

"It plays with ambiguity, and potentially supernatural elements," Tremblay said. "It's basically about a teenager on a sleepover with friends. They sleep in a state park and his friend, Tommy, doesn't come back. The rest of the book is figuring out what happened to him."

Tremblay has been told that the premise is similar to that of the television show, "Stranger Things," but said his book came out before the show and wasn't influenced by it in any way.

"The show goes in a much different direction," he said. "But the show has been helpful, because people say, 'If you like 'Stranger Things' you should read this book.'"