A U.S. Marshal who died in a shootout in Pennsylvania earlier this year was killed by friendly fire not by a fugitive wanted for shooting a pregnant woman, authorities said Thursday.

Deputy Marshal Chris Hill was killed in a hail of gunfire after a tactical team responded to a home in Harrisburg, Pa., where Kevin Sturgis was hiding out on Jan. 18. Sturgis, 31, was wanted for the shooting of a pregnant woman in Philadelphia and responding cops expected him to be armed as they stormed into the residence.

As officers secured the first floor, Sturgis started firing at them from the top of a staircase and screamed, “are you looking for me?” Dauphin County District Attorney Francis Chardo said in a statement.

Chaos broke out and several officers started blasting away at will. One of the police bullets passed through a wall and struck Hill, Chardo said.

Pa. home left riddled with bullet holes after deadly shootout

Hill was rushed to a hospital but could not be saved. Sturgis was killed in a subsequent shootout outside the house. A second officer, Kyle Pitts, suffered a gunshot wound to his arm but survived.

Police initially speculated that Hill died from one of Sturgis’ bullets, but Chardo’s extensive investigation concluded that it was actually a fellow cop who inadvertently killed him.

“Deputy Marshal Hill died a hero,” Chardo said. “The results of this investigation do not in any way diminish the heroism exhibited by the other members of the team on that day.”

Chardo added that Sturgis will still be held responsible for both his and Hill’s deaths.

Gunman kills three in Pennsylvania rampage

“Sturgis maliciously and unnecessarily set in motion the exchange of gunfire that led to both deaths,” the district attorney said.