Dr. William Petit was a diaper-clad 2-year-old in 1959 when he wandered from his family home in Plainville and helped himself to the next-door neighbor’s strawberries.

Decades later, a beaten and bloodied Petit escaped his family’s home in Cheshire, this time in desperate need of help from his next-door neighbor under tragic circumstances. Few can comprehend the depth of depravity that was visited on his family in a July 23, 2007, home invasion in which his wife, Jennifer, and two daughters were tortured and murdered.

Acclaimed journalist Ryan D’Agostino covered the trials of the two assailants in New Haven Superior Court, sometimes staying in the Westport home of his sister, Elizabeth Carpenter, and her husband, Joe, rather than return to New York each day.

As an editor for Esquire magazine, D’Agostino wrote two articles about William Petit’s indomitable spirit. D’Agostino, a former Westport News reporter, has authored a book about the horrific tragedy and Petit’s journey from darkness back to life, where he has found love again as a husband to Christine and father to William III, who will celebrate his second birthday on Nov. 23.

D’Agostino, now the editor in chief for Popular Mechanics magazine, spoke at the Westport Public Library’s McManus Room on Nov. 12, about the crime and Petit’s remarkable recovery. He read to an audience of 25 people several passages from his new book, “The Rising: Murder, Heartbreak, and the Power of Human Resilience in an American Town,” released in September by Crown Publishing.

Kelle Ruden, the library’s director of programs, said D’Agostino is the only reporter Petit has spoken to at length.

“He draws on interviews born of that trust to bring to life Bill’s poignant, harrowing, and yet ultimately inspiring journey,” Ruden said.

D’Agostino was given unprecedented access to Petit, his family and friends.

“He shared with me his story; I felt like I was a better person for knowing him,” said D’Agostino, a West Hartford native who has also written for The New Yorker and other publications. “Getting to know him made me a better father, a better husband; I wanted people to get to know him as I did.”

He recounted one dinner at which the once broken man placed a hand on D’Agostino’s shoulder and told the young father of two, “Spend time with your kids.”

“We all hear it, ‘They grow up so fast,’ but when you hear it from him …,” D’Agostino’s voice trailed off, one of two times when he showed emotion during his hourlong presentation.

The other time was as he read a passage in the book about the number of young girls — friends of Petit’s daughters, Hayley, 17, and Michaela, 11, all dressed in black at the memorial service five days after their deaths. D’Agostino’s voice caught and his eyes welled momentarily.

It is emotional material. D’Agostino said people have told him they are afraid to read his book, given the unimaginable horror of the crime.

“I understand that completely,” he said.

D’Agostino said the tragedy shook him, too. But he did not want to, nor did he, write a “true crime” book. “The Rising” is an uplifting story about Petit’s triumph in the face of adversity.

“In order to know the man, you have to know about the crime in all its horrificness … He’s a survivor,” said Ron Taylor, of Stratford.

“I think he’s an amazing man,” added a woman who only identified herself as “Liz from Fairfield.”

D’Agostino said Petit will never be the same again but, “he’s finding a place in the world; a new place.”

“(D’Agostino’s) a hell of a good writer, he’s a great story teller — the raindrops hitting the petals of the flowers,” Taylor said, paraphrasing D’Agostino’s description of that tragic July morning.

“A warm rain falls, soaking the midsummer-green grass and bobbing the heads of the orange flowers in the front yard,” D’Agostino read from his second chapter.

Jeri Kelley, of Fairfield, said she wished she could listen to D’Agostino read the whole book to her.

“I followed this (story) every day. I had to come and I wanted to get the book,” said Kelley, who had D’Agostino autograph it, as did others.

The library seemed an appropriate venue for D’Agostino’s presentation. He shared with the audience that his first job right out of college was with the Westport News, and his first assignment sent him to the Westport Library to cover a question about its structural integrity.