HAMPTON, N.H. - Marked by somber ritual and touching remarks, the service gathered young and old, from parents pushing young children in strollers to old men with canes. Some came in formal dark, others in weathered motorcycle jackets. Long before the service began, mourners filled the bleachers, police officers lined up for the traditional funeral march, and a pipe and drum corps awaited its duty.

They had come by the thousands to mourn Michael Maloney, small-town police chief, husband, father, brother. In his death, they said, the chief of the Greenland Police Department demonstrated the courage that defined his life.

Maloney died last week, felled in a fusillade during a drug raid. Four other officers were wounded. The man accused in the chief’s slaying took his own life and that of a woman inside the house where the violence began, an autopsy found.

Get Fast Forward in your inbox:

Forget yesterday's news. Get what you need today in this early-morning email.

The 48-year-old chief was days away from celebrating the end of a 26-year career in law enforcement, and yet he chose to participate in the raid, even pulling the injured to safety when met with gunfire.

Under clear skies and a soft sun, flags flew at half-staff, rustling in the breeze. A deep silence fell over the field as eight police officers carried Maloney’s casket, shrouded in the American flag. Dozens of family members followed, circling the field as rows of officers stood at attention.

In the stands, mourners held hands to hearts. Some fought back tears.

The four other men shot in the raid were also in attendance and were recognized as heroes in their own right. They came under attack as they tried to execute a search warrant at the home of Cullen Mutrie, 29, a suspected drug dealer with a violent past.

Maloney “would never ask anything of his fellow officers he would not do himself,’’ said US Attorney General Eric Holder. “He stood his ground and stayed with his team.

“Let it never be said that he died in vain,’’ Holder said. “His legacy will live on.’’

A devoted family man, Maloney had looked forward to retirement and spending more time with his family, especially its newest addition, his young grandson MJ.

US Senator Kelly Ayotte said MJ should one day know that his grandfather “made the ultimate sacrifice because he loved others.’’

“Our hearts are broken,’’ she said. “New Hampshire lost one of its finest sons.’’

Tim Maloney called his brother “one of the good guys,’’ a genuine spirit with a fondness for Hawaiian shirts, football, and Grey Goose vodka.

Maloney was an avid motorcyclist and fisherman, friends said. He reveled in small-town life, its pace and traditions.

He had an “inherent decency,’’ said Francis Frasier, a retired judge. Frasier recalled how Maloney always directed traffic at the town fair and was sure to tell all the children to have fun.

He was a man “full of life,’’ Frasier said. “And a man whose life was full.’’

David Kurkul, a police officer in Greenland, said Maloney never failed to speak his mind, which could cause awkwardness but often got results. He liked being involved in calls, he said, but gave his officers free rein.

“It was always understood that he had confidence in the ability of his people,’’ he said.

Maloney usually arrived at the station before 6 a.m. to see off the night shift and welcome their replacements, Kurkul said.

He supported officers through the day-to-day challenges and celebrated milestones in their lives, he said. He knew his officers, and their families, well.

His voice quavering, Kurkul said he would always hold memories of Maloney dear, especially getaways to Boston, Foxwoods, and North Conway. “Every trip was an adventure,’’ he said.

After the guns fired in salute and the pipes played their mournful strain, silence fell over the field deep and unbroken. Standing shoulder to shoulder, police officers stared hard into the distance, eyes fixed.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.