Anchorage police officer Arn Salao encountered 40-year-old James Dale Ritchie early Saturday morning after a report of an unpaid cab fare, authorities in Alaska said.

Salao tried to stop the man, according to a police department news release. But Ritchie responded by opening fire on Salao.

Ritchie was killed, and Salao was hospitalized with gunshot wounds.

Now, days after the shooting, Anchorage police said that they have linked the gun that Ritchie wielded to five homicides, all of which happened this year.

According to the Alaska Dispatch News, there was the July 3 killings of a 20-year-old and 41-year-old, which occurred on a bike path. And there was the homicide that happened the same month, on July 29. That victim was 21 years old. Then, on Aug. 28, there was another double homicide, in which a 34-year-old and 25-year-old were killed.

All have been linked to the same gun, a Colt Python .357 magnum, following the weekend police shooting.

“We know from our investigation in the last 78 hours that the gun used to attempt to kill Officer Salao was the same gun used in five other homicides here in Anchorage in 2016,” Anchorage Police Department Chief Chris Tolley said at a news conference Tuesday, according to the Dispatch News.

However, APD spokeswoman Jennifer Castro told The Washington Post on Wednesday that while the gun has been linked to the two double homicides, that does not necessarily mean that Ritchie has been.

“We have not identified the suspect in the double homicides in which the gun has been linked to,” she said.

That’s not the case with the July 29 homicide, though.

“That one, we do have enough evidence to support that James Dale Richie was the suspect in that case,” Castro said.

The break in the cases came after an early-morning exchange of gunfire between Ritchie and police, an incident that began with a call to dispatchers Saturday.

Authorities received a call about a man who had refused to pay his cab fare and instead walked away, police said in the news release. Salao spotted a man walking down the street and tried to stop him, the release stated.

But the man didn’t stop, so Salao pulled over his car in another attempt to make contact. That, authorities said, is when Ritchie turned and drew his gun. Over the weekend, Tolley described the shooting of the officer as an ambush.

“It’s horrific. It is really sad,” Tolley said in a recorded statement about the attack, noting that he had seen video of the incident.

Ritchie was killed in the encounter. Salao was rushed to a hospital, where he underwent emergency surgeries. He remained hospitalized in stable condition Wednesday, Castro said.

“It is very troubling, but I’m so proud of our officers in that they were able to apprehend this individual to keep anyone else from being hurt,” Tolley said earlier. “These men and woman are out on the streets of Anchorage each and every day and night protecting our citizens.”

Here are the details on the five homicides, according to the Anchorage Police Department:

July 3 homicides of Jason Netter and Brianna Foisy: Authorities received a call from a bicyclist, who reported two bodies on a bike path. Police didn’t find any shell casings but did collect some ballistic evidence. Area residents reported that they heard gunshots between 3 and 5 a.m.

July 29 homicide of Treyveonkindell Thompson: Multiple neighbors called to report gunshots and a man down in the street. The victim was pronounced dead at the scene after authorities arrived. Witnesses who saw the gunman before the shooting helped investigators create a composite sketch, which was released. More than 175 tips came in about the sketch.

Aug. 28 homicides of Bryant De Husson and Kevin Turner: A woman contacted police, saying she found a man’s body on a bike path. The man was pronounced dead at the scene; a second victim, who was also dead, was discovered under a park pavilion. It didn’t appear as though the victims knew each other.

The department said that after this weekend’s police shooting, the gun was sent to Alaska’s state crime lab, and ballistics testing confirmed that it had been used in the five homicides.

Additionally, Ritchie’s driver’s license photo resembled the composite sketch that was released in the previous case.