Editor's Note: Some of the footage in this story may be difficult to watch.

Police in Southern California gave an emotional salute Tuesday to a K-9 killed during a deadly SWAT standoff in Long Beach.

K-9 Credo and the suspect, who was armed with a knife, were both fatally shot.

A SWAT team had been locked in a standoff in the 2800 block of East 15th Street with a man wanted in a shooting case involving multiple victims, the Long Beach Police Department said. The investigation began around 9 a.m.

Officers said the man aggressively charged at police, who deployed intermediate force options, including a 40mm rubber baton round and a police service dog that was part of a special weapons team.

The service dog, a 4-year-old Belgian Malinois named Credo, tried to stop the man's advance toward officers, Long Beach police said.

As Credo fought with him, the man produced a knife. One officer fired his weapon to protect himself and the other officers, authorities said. Both the suspect and Credo were struck by the officer's gunfire. The knife was recovered at the scene.

The suspect, who was not identified, was taken to a hospital, where he was pronounced dead. No other injuries were reported, police said.

After shots rang out, aerial images showed a clearly distraught officer laying the dog’s limp body on a sidewalk and throwing his helmet to the ground. He then picked the dog up again and placed him in the back of a police cruiser. The canine was rushed to a veterinary clinic, where he died of his injures.

Credo served with the department for two years.

Photos of Credo posted on the Long Beach Police Department's Facebook page in 2014 identified his handler as Officer Mike Parcells, who lost another 4-year-old Belgian Malinois during a shooting in 2005.

Long Beach police officers stood in formation for a farewell to Credo outside the veterinarian's office Tuesday afternoon. Parcells appeared inconsolable, breaking down in tears as Credo was loaded into the K-9 cruiser.

Parcells, an officer for more than 21 years, is dealing with Credo's death 11 years after the death of K-9 Ranger, another K-9 killed in the line of duty.

Many residents came out to pay respects to Credo, who was involved in more than 30 apprehensions in his police career.

City News Service contributed to this report.