Martin Stewart, aspiring novelist and full-time Scottish schoolteacher, had a literary agent and a manuscript that numerous editors agreed was superbly written, but probably not right for middle grade readers. It was about marionette puppets that had come alive and were trying to kill children. “Does he have anything else?” one editor asked.

The agent, Molly Ker Hawn of the Bent Agency, forwarded a proposal that she and Stewart had for a different novel and—unbeknownst to Stewart—attached a 2,000-word short story Stewart had posted on the blog of another writer Hawn represents. “It was just a jewel, funny and scary and sad and so gorgeously written—it really showed off Martin’s talent,” Hawn says.

Stewart’s inspiration came from a newspaper story about a man whose family business, for generations, had been to save the drowning or recover bodies from the Clyde, the river that flows through Glasgow. This “riverkeep” had taken over from his father when he was 14. “From the mindset of someone who is trying to write for children, the idea of doing that at 14 just seemed so unusual, such a committed life of public service,” Stewart says. “I couldn’t do that now as an adult.”

The editor loved Stewart’s story and offered a contract to expand it to a YA novel. But Hawn wanted a deal for her client that would allow him to write full-time. “I called a couple of other editors to tell them I had an offer for a debut author based on a four-and-a-half-page short story, and I could hear them rolling their eyes, but I said, ‘Look, it’ll take you five minutes to read.’ ”

Amy Alward at Penguin Random House Children’s UK called Hawn back an hour later, wanting to talk to Stewart immediately. Ultimately, Hawn got several offers but sold world rights to what would become Stewart’s first novel, Riverkeep (Viking, July), to Alward.

Then he had to write it.

Stewart quit teaching at the end of 2014. “I had never done anything to this scale before and I was a bit terrified,” he tells PW by telephone from his home in a town on the Scottish coast. Perhaps nothing motivates more than panic: Stewart wrote a draft—83,000 words—in six weeks, then spent two more weeks editing before sending it to Hawn. “That was just pure terror. There was every possibility I would submit something that wouldn’t be up to scratch and they’d ask me to return the advance.”

Stewart need not have worried. His epic tale about Wulliam, who reluctantly becomes riverkeep after a sea demon disables his father, received praise in both the U.K. and U.S. Reviewers compared Stewart to Tolkien and Le Guin; many singled out the repartee between Wull and the crew he picks up on his quest to find the monster that harmed his father as a highlight.

“One thing I had wanted to do was write a book that was identifiably Glaswegian,” Stewart says. “There’s a cheerful belligerence in the way people here talk to each other that’s particularly Scottish. To insult your best friend to their face is to show them that you love them.”

Stewart, who “set [his] cap at being a writer at 19” and sold his first book at 32 (he turns 34 this month), spent more than a decade imagining publication. Reality turned out to be better. Penguin has signed up a second book, titled The Sacrifice Box, which he’s revising. “I’m slowly eviscerating my third draft,” he says. “It turns out I really, really overwrite.”

Even publishing his first novel simultaneously on both sides of the Atlantic turned out to be a wonderful thing. “I was really lucky that there wasn’t a finished U.K. version before the U.S. people went to work because I had two whole editorial teams working to strengthen it,” he says. “The book was enriched by the input of so many people.”