Christopher David Hill, 45, was part of a team serving an arrest warrant on a woman when gunfire erupted, authorities said. Hill suffered a fatal wound, and another team member, York City Police Officer Kyle Pitts, was injured by the gunfire.
U.S. Attorney Dave Freed said there are indications a third officer may have been struck in his body armor but was not wounded.
"None of us has sufficient words to express our grief and sorrow," Freed said.
Investigators identified the shooter as Kevin Sturgis, 31, of Philadelphia. Sturgis was killed by law enforcement officers at the scene.
Authorities said at the time of the incident, Sturgis had two active warrants from the City of Philadelphia. One for failure to appear for a firearms charge and one for not appearing for a probation hearing on a receiving stolen property, possession of controlled substance and unauthorized use of an automobile charges. They said Sturgis also had a juvenile adjudication on a charge of rape.
Officials said the incident began when a team of about seven showed up at the woman's home before sunrise to arrest her on a charge of making terroristic threat with a weapon.
The woman, Shayla Lynette Towles Pierce, was being handcuffed on the first floor when gunfire came from the second floor, Freed said.
Sturgis subsequently exited front of the home and began firing, Freed said. Hill and Pitts were able to get out the back of the building.
Hill died at a hospital. Authorities said Pitts required surgery but his injuries are not considered life-threatening. He is a 10-year veteran of the York City Police and has three children.
Freed said investigators are still working to piece together the chaotic events.
Hill, who is survived by a wife and two children, was an Army veteran who served in Afghanistan before being hired by the marshal's service in 2006. He was an 11-year veteran of the USMS, assigned to the Middle District of Pennsylvania.
"Deputy Hill served the American people and the citizens of the community with courage," said U.S. Marshal Martin Pane.
Harrisburg Mayor Eric Papenfuse said a city police officer "bravely returned fire and critically injured the gunman."
"No words can adequately express the sadness we feel at this moment as we contemplate the loss of yet another law enforcement officer in the line of duty," Papenfuse said.
The shooting occurred less than 2 miles from the state Capitol, in a working class neighborhood of duplexes, single-family homes and commercial buildings.
The shooting occurred near where police shot and killed an Egyptian immigrant on Dec. 22 after he wounded a state trooper and shot at another officer near the Capitol. That man is believed to have acted alone.
Towles was committed to Dauphin County Prison in lieu of $200,000 bail.
Send a breaking news alert
Report a correction or typo
Learn more about the 6abc apps