A Philadelphia SWAT team officer was shot and killed early Friday as he and other officers were attempting to arrest a murder suspect.

Cpl. James O’Connor, 46, is the first police officer killed in the line of duty in Philadelphia in five years, according to reports.

The officer was struck by gunfire just before 6 a.m. at a home where the SWAT team was attempting to serve a warrant on the murder suspect. Officers returned fire.

OFFICERS KILLED IN THE LINE OF DUTY IN 2020

“We just want everyone to know it’s a very sad day,” Police Commissioner Danielle Outlaw said, Fox 29 Philadelphia reported. “Not just for officers here but it’s a very sad day for the family who is here and who is mourning and still trying to stomach all of this now.”

Officer gunfire wounded two occupants in the home, the station reported. They went to the hospital.

Two others were taken into custody, including the person named in the warrant.

The person was wanted in connection with a March 2019 homicide, the station reported.

O’Connor, a married father of two, including a son who also serves on the force, had been a police officer for 23 years and was with the SWAT unit for 15 years. His daughter serves in the U.S. Air Force.

KILLER OF TEXAS POLICE OFFICER DAVID SHERRARD IS SENTENCED TO DEATH

Officers were seen blocking Philly’s top prosecutor Larry Krasner from entering the hospital before leaving, Fox29 reported. Krasner, who has sued the police department more than 75 times, according to the Wall Street Journal, has a tense relationship with officers, who accuse him of coddling criminals, being soft on crime and demoralizing the police department.

"The reason I am here is that we've had a very serious incident involving a police officer. I'm not going to get in front of the police commissioner and talk about details." Krasner told the station. "I'm here for the victim, for the victim's family, for any survivors, and also just to show how much we care about our law enforcement officers."

Last year, after six cops were shot, Philadelphia’s top federal prosecutor William McSwain issued a statement charging Krasner with promoting and championing a “new culture of disrespect for law enforcement" in Philly.

CLICK HERE TO GET THE FOX NEWS APP

"I am fed up with it,” McSwain said.