Sometimes the road not taken intersects with your chosen path decades later.

After an uninspiring experience in a college creative writing class, Bruce Robert Coffin put aside his dreams of becoming an author. Instead, he spent more than 27 years in law enforcement, retiring as a detective sergeant with the Portland Police Department.

Now he’s preparing for a new career as a mystery writer, thanks to his full-length debut, “Among the Shadows,” published by HarperCollins’s Witness Impulse imprint. The Portland-based novel introduces readers to Detective Sgt. John Byron, a seasoned cop investigating the apparent murders of retired fellow police officers, even as he struggles with department politics, a crumbling marriage and a dangerous reliance on alcohol.

Born in Portland, Coffin grew up in Scarborough and attended the University of Southern Maine. He was hired as a police cadet by the Portland Police Department in 1985, retired in 2012 and now lives in Windham with his wife, Karen.

In a telephone conversation, it’s clear that Coffin, at age 52, still feels the sting of rejection from his undergraduate writing experience.

“I had intentionally taken an advanced class,” he said. “All of a sudden, I had gone from getting straight As for anything I wrote and winning scholarships with my writing ability to barely squeaking out a D.”

The low grades took their toll on Coffin’s literary aspirations. “When you’re younger, it takes very little to derail dreams like that,” he said.

So Coffin put his writing aside and began a career in law enforcement.

After attending the police academy, Coffin walked a beat in Portland. “Back then, things were different,” he said. “You really paid your dues. Everyone walked a foot beat for a couple years before you ever (drove) a car.”

Early on, it was criminal investigations that drew his interest: “the follow-up work, making contacts, figuring out who on the street knew who and where you could get good information.”

Eventually, his career took a turn into traffic enforcement, where he did a lot of operating-under-the-influence work and became an accident reconstructionist. In 1997, he was promoted to detective and began investigating property crime, before concentrating on homicides and armed robberies.

Among the more high-profile cases he worked was the 2001 murder of Amy St. Laurent, a 25-year-old young woman who disappeared after a night in Portland’s Old Port. Her body was located two months later, and the evidence eventually led to the arrest of Jeffrey “Russ” Gorman, who was convicted and sentenced to 60 years in prison.

“A lot of times the victims’ activities are the reasons they wind up in bad conditions. It was quickly apparent that wasn’t the case with Amy,” Coffin said. “She was actually a good kid and squared away.”

Following the Sept. 11 attacks, Coffin spent four years working counterterrorism with the FBI. Coffin earned the Director’s Award, the highest honor a non-agent can receive from the FBI, before returning to his work with the department.

Coffin had begun a side career as a painter of portraits and other commissioned artwork, but he didn’t tell too many people about his renewed attempts to write fiction. He spent 2½ years finishing a mystery novel titled “Deathwatch.” He showed it to some writer friends, who “thought it was good for a first novel.”

Kate Clark Flora, former assistant attorney general, mystery writer and a co-author of “Finding Amy: A True Story of Murder in Maine,” an account of the St. Laurent investigation, took an early interest in Coffin’s work.

“He started out good and has put lots of time and effort into learning the craft and perfecting the craft,” she said by email.

She invited Coffin to the annual New England Crime Bake writers’ conference. By the time the weekend was over, Coffin said, he had an entirely different idea for his book. He basically started from scratch, dictating a new synopsis during his 2½-hour drive back to Maine.

That new idea would eventually become “Among the Shadows.” Awash in local color, steeped in a sense of realism born of decades of law enforcement experience, the completed novel spotlights John Byron as a complicated man in a difficult job. Shaped by the suicide of his father (also a cop), Byron has turned into a relentless investigator, pushing himself to extremes while seeking the truth and protecting the other members of his team. He’s a familiar type, but given a very specific, Maine-centric twist.

Mystery writer Paul Doiron, author of “The Precipice,” said that it is the setting that makes “Among the Shadows” stand out.

“Portland is a distinctive little city with an old shipping and fishing heritage, waves of immigrants from Asia and Africa who have made a real impact on the culture, and a recent hipster trend,” Doiron said by email. “Bruce really gets how unusual Portland is, and you sense it beneath the story.”

Maine thriller writer Chris Holm, author of “Red Right Hand,” complimented another aspect of authenticity in Coffin’s work. He comes from “a cop family,” he said in an email, and “Detective Sergeant Byron’s world-weariness and dented optimism wouldn’t have seemed out of place at my grandma’s Sunday dinner.”

Coffin’s persistence with this book paid off. Within the course of a few weeks, he landed an agent and a contract for three books with the Witness Impulse imprint, which publishes e-books and trade paperbacks. To top things off, his first short story written since college, “Fool Proof,” has also been selected for inclusion in Houghton-Mifflin Harcourt’s “Best American Mystery Stories 2016.”

At work on the second John Byron mystery, Coffin is able to see the upside in having taken so long to find his fiction groove and put his college creative writing disappointments into perspective.

“Now that I’ve done 28 years in a law enforcement career, I have something to write about,” he said. “I have all those experiences I’ve carried around with me. I think maybe that if I had not been derailed by [that writing class], I wouldn’t be where I am today.”

Berkeley writer Michael Berry is a Portsmouth, New Hampshire, native who has contributed to Salon, the San Francisco Chronicle, New Hampshire Magazine, the Los Angeles Review of Books and many other publications. He can be contacted at:

[email protected]

Twitter: mlberry