Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A Philadelphia police officer was fatally shot while serving a warrant at a home just outside the city center early Friday morning.

SWAT Cpl. James O’Connor, a 23-year veteran, was serving a homicide warrant in the Frankford neighborhood at 5:41 a.m. when someone opened fire from behind a closed door on the second floor of the house, police said.

O’Connor, 46, was struck in the shoulder, and rushed to Temple University Hospital, where he was pronounced dead at 6:09 a.m.

We are devastated to report the passing of PPD SWAT Officer Cpl. James O’Connor. Cpl. O'Connor, a married father of 2,was shot and killed this morning while serving a warrant on a homicide suspect. We stand with his family, friends, and everyone impacted by this senseless tragedy pic.twitter.com/gkfvdn9zNC — Philadelphia Police (@PhillyPolice) March 13, 2020

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"These officers didn’t get a chance," Police Commissioner Danielle Outlaw told reporters outside of the hospital. "The gunfire happened immediately, as soon as they walked through the door."

The SWAT team was looking to arrest a suspect in a 2019 homicide, NBC Philadelphia reported. That person was taken into custody uninjured.

Two other people in the home were shot when another SWAT officer returned fire. They were taken to a hospital and were in stable condition.

O’Connor had served 15 years on the SWAT team, and was a married father of two, Outlaw said. His son is a 9th district officer and his daughter is an active-duty Air Force member.

"I don’t even know if 'unbearable' is the word — there's not a word for the emotion that’s being felt right now," Outlaw said.

"It takes a special person to do this job and that's who this corporal was," she added.

Fraternal Order of Police President John McNesby and Mayor Jim Kenney joined the police commissioner at the hospital Friday morning.

"I am grief-stricken to learn of the tragic death of Philadelphia Police Cpl. James O’Connor," Kenney said in a statement. "Today, like every day, he demonstrated the ultimate form of heroism: putting out his uniform, leaving his family and carrying out his sworn duty to protect the residents of this city."

The mayor ordered all city flags to be flown at half-staff for 30 days.

"This is a sad and tragic day," said McNesby. "Corporal O’Connor came to the Philadelphia police department from a family of dedicated officers. He served this department and city with dedication, honor and dignity for 23 years."