Police officers and their K-9 partners traveled from Portsmouth, New Hampshire, to Gillette Stadium on Tuesday morning to pay final respects to Police K-9 Kitt.

Kitt was killed in the line of duty on June 4 during an exchange of gunfire outside an apartment complex in Braintree, Mass. He is credited with helping two police officers, who were also shot while responding to the domestic incident.

A woman had reported that an armed man fled into the woods during a dispute. Kitt was called to the scene 45 minutes after officers initially arrived.

Kitt and the two officers who went into the woods to find the man were "essentially ambused," according to Chief Mark Dubois.

Kitt was a member of the Braintree Police Department for 12 years. He was responsible for the safe apprehension of many violent criminals during his law enforcement career, according to members of the Braintree Working Dog Foundation.

Kitt's funeral service on Tuesday was limited to invited guests, friends, family and law enforcement but people lined the streets in Braintree as his body was escorted from a funeral home.

When he arrived at Gillette Stadium, there were hundreds of officers there to pay their final respects.

The service for Kitt, who was a Belgian malinois, was scheduled to begin at 11 a.m.

WARNING: The image below may be disturbing to some readers.

Portsmouth Police Department

Off. Bill Werner and his K-9 partner Frankie, along with Off. Aaron Stacy with his K-9 partner Axe, were there representing Portsmouth.

"Rest easy K-9 Kitt, we will take watch from here," Portsmouth police wrote on their Facebook page.

Portsmouth Police Chief Mark Newport said Kitt was a good working dog.

"It was an unfortunate incident, but the dog did what he was trained to do," Newport said. "It's sad to lose any member of our family, whether it is an officer or one of our K-9s."

Portsmouth Police Department lost a dog on May 23, 2019. Max, a six-year-old German Shepherd, was injured just prior to a training event in Rollinsford.

Max was jumping over a wooden structure and hit his abdomen. The blood supply to his intestines was cut off and veterinarians could not save him.

Contact Managing News Editor Kimberley Haas at Kimberley.Haas@townsquaremedia.com.

LOOK: 30 fascinating facts about sleep in the animal kingdom