Updated

A Massachusetts police officer killed in the line of duty was remembered at his funeral service on Wednesday for his faith, professionalism and engaging personality.

Hundreds of family, friends and colleagues packed St. Pius X Roman Catholic church for the funeral Mass of Sean Gannon, a K-9 officer with the Yarmouth Police Department. Thousands of officers from around the country stood at attention outside.

A line of blue created by uniformed officers marched from the local high school to the church before the service started. It was made up by representatives from departments across Massachusetts and New England, from New York City and Chicago, and from as far away as Texas and California.

Hundreds of civilians also stood outside the church.

"We give him back to you without a murmur, but our hearts are wrung with sorrow," the Rev. Paul Caron said during a short service without a eulogy.

Caron told the story about the day he arrived at the Cape Cod parish last year. A secretary called to tell him police were on the way to his office.

"I wasn't here long enough to be in trouble," Caron said.

He heard a bang on his door and the words, "Police! Open up!"

He opened the door to find Gannon, who hugged him and welcomed him to town.

"So now we come together and mourn his death, but we also give thanks that he lived, that we knew him on some level," Caron said.

Gannon, 32, was shot Thursday while he and other officers were serving an arrest warrant at a home in Barnstable. The suspect in the shooting, described by police as a career criminal, is being held without bail after pleading not guilty to murder.

Gannon's Belgian malinois dog, Nero, also was shot but underwent surgery and is recovering.

After Wednesday's Mass, K-9 officers and their dogs lined the route to the cemetery for a private burial service.

Gannon, who was posthumously promoted to sergeant, leaves behind a wife, parents, a brother and a sister.

The New Bedford native was a graduate of Bishop Stang High School in Dartmouth and Westfield State University. He had a master's degree from the Massachusetts Maritime Academy.