Patrolman Keith Gilman's longtime dream of becoming a mystery novelist was nurtured in the few spare moments he could steal away.

The Haverford Township police officer scribbled in a notebook while he waited for his daughter during her dance class. He mulled over plot twists and character development during almost two-hour commutes to work.

Eventually, the story of Lou Kline took shape. A Philly-cop-turned-private-eye, Kline would spend 270 pages looking for the missing daughter of a friend and confront some personal demons about his father, a cop who died in the line of duty.

The tale that Gilman crafted in two years of scattered moments has become a book, Father's Day - a goal the budding writer accomplished with the help of some literary heavyweights.

"I'm dreaming big," said Gilman, 49, of Clarks Summit, Pa.

Father's Day was released April 28 by Minotaur Books, a division of St. Martin's Press. The novel's publication was Gilman's prize for winning a prestigious writing competition, the 2007 St. Martin's Press/Private Eye Writers Association Best First Private Eye Novel Contest.

He also won a $10,000 advance and a contract, with hope that he would develop a series of books based on the Kline character.

Gilman beat out 100 other entrants. When he entered, he had no agent. Now he has Sam Pinkus, who represents Mary Higgins Clark and Harper Lee. When Gilman won, he had no editor. Now he has worked with Ruth Cavin, 90, who has been called the "First Lady of Mysteries." Cavin, a native of Pittsburgh, picked Gilman's book as the winner.

"Keith's was the most original," said Cavin, associate publisher and senior editor of Thomas Dunne Books, also a division of St. Martin's. "There were other good novels, but none of them had the father-son relationship that Father's Day had."

Gilman's father, Irving, a Sherlock Holmes fan, turned Gilman on to reading mysteries, which led to writing. Keith Gilman grew up in Scranton and earned a bachelor's degree in criminal justice from the University of Scranton. He studied while working on the campus police force and with the Lackawanna County Sheriff's Department.

By the time he was 30, Gilman was married with a child and subsisting on low-paying part-time police jobs in small towns around Scranton. He joined the Haverford department to advance his career, but his family was settled in Scranton. Gilman decided to commute, a ride made easier by the mysteries on tape he often listens to. He stays in an apartment near Haverford when working.

He has had the writing bug since he was young.

"I was a fairly poor student, but teachers would say: 'You don't do your homework. You don't pay attention in class. But you're a pretty good writer,' " Gilman said.

At the onset of middle age, Gilman decided he could no longer put it off. He wrote short stories for crime magazines. When he finished Father's Day, he submitted it to publishers but repeatedly was turned down. The contest was the break he was waiting for.

Gilman's colleagues have been supportive, Haverford Police Lt. Mark Harnish said.

"We might not admit it, but in the back of our minds, it's like, 'Uh-oh. Are we going to be part of the plot line?' " Harnish said. But Gilman avoided using specifics from the job.

Reviews have been pretty good. Gilman scored a book-jacket blurb from the best-selling novelist William Lashner, a Bala Cynwyd lawyer who gave up the law to write crime novels.

"He's a cop, and that comes out in the writing," Lashner said recently. "There's a knowing, hard-boiled humor that comes legitimately from his work."

Gilman is two-thirds of the way through his second novel. He hopes someday to write full time, study for a master's degree, and teach.

Until then, he will continue to ride the beat, which he said had served him - and his writing career - well.

Being a police officer "is the single best learning experience a person can have," Gilman said. "And you get a chance to see what you're made of, test yourself every day. You learn a lot about life and a lot about yourself."