Gannon was Yarmouth's first full-time K-9 patrol officer, and his dog, Nero, was also shot in the incident, according to Boston ABC affiliate WCVB.
According to a Facebook post by Yarmouth police, Nero has survived emergency surgery and is being treated for his injuries.
Thomas Latanowich hung his head throughout his brief arraignment in Barnstable District Court, speaking only to answer "yes" when the judge asked if he understood the proceedings.
A police officer on Cape Cod was shot in the head and killed Thursday while serving a warrant, local media reported.
Not-guilty pleas to charges including murder were entered on his behalf, and the judge said she would appoint a lawyer to represent him.
"I'm just disgusted with what was dealt to officer Gannon", Yarmouth Police Chief Frank Frederickson said during a press conference Thursday night at the department's headquarters.
"We refer to him as the Tom Brady of the Yarmouth Police Department and he's gone". Gov. Charlie Baker ordered flags be lowered to half-staff at all state buildings in Gannon's honor. "Our department is going to miss him terribly".
Suspect Todd Latanowich, 29, of Somerville, Mass., has a long criminal record, Yarmouth police said.
Latanowich's next court date was scheduled for June 26.
Gannon was attempting to serve the suspect a warrant when he was shot, and was apparently searching the home's attic to find the suspect when it happened, according to News 7 Boston.
Latanowich - whose last known address was in Somerville - was apparently hiding in the attic and shot Gannon and his dog as the K-9 team started to enter the attic, a law enforcement official confirmed.