(CNN) -- A 30-year-old man has confessed to shooting a Philadelphia police officer Thursday night in the name of the "Islamic State," presumably referring to the terrorist group ISIS, according to officials at a news conference on Friday.
Philadelphia Police Officer Jesse Hartnett was hit three times and suffered "some very serious injuries that will require multiple surgeries," Philadelphia Police Commissioner Richard Ross told reporters Friday. Despite being seriously injured, he exited his patrol car and shot the assailant, who later was apprehended by other officers, Ross said.
The alleged assailant appeared to be targeting a police officer, Ross said. "He was trying to assassinate this police officer."
Radio from Thursday shows Hartnett shouted desperately into his police radio after someone, authorities say, approached his patrol car and shot him as he sat there Thursday night.
"Shots fired! ... I'm bleeding heavily!" Hartnett shouts in a recording of his radio call for backup. "I'm bleeding. Get us another unit out here!"
Hartnett not only survived but managed to fire back and wound the gunman after what authorities say was an apparent attempt to execute the officer at a city intersection.
The gunman fired 13 shots from a semiautomatic pistol into Hartnett's car as the officer sat in the driver's seat, a law enforcement source told CNN. The shooting happened about 11:30 p.m. in west Philadelphia, CNN affiliate KYW reported.
Hartnett was shot three times in an arm and returned fire, the source said. The alleged gunman was shot and eventually was arrested and taken to a hospital, according to KYW.
Hartnett also was taken to a hospital, where he underwent surgery for a broken arm, KYW reported.
A picture -- one that the Philadelphia Inquirer newspaper says is a still frame from surveillance video of the shooting -- shows a person standing right next to the car with his arm through the lowered driver's-side window, close enough to be shooting someone at point-blank range.
The Inquirer did not report where it got the picture. But Philadelphia Police Commissioner Richard Ross told reporters earlier Friday that he had seen video of the incident and that it was "absolutely one of the scariest things I've ever seen."
CNN hasn't independently confirmed the authenticity of the image. Information on the origin of the video that Ross referenced and what Hartnett had been doing in the moments leading to the shooting wasn't immediately available.
"This guy tried to execute the police officer. The police officer had no idea he was coming," Ross said. "It's amazing he's alive."
Ross said it appears Hartnett suffered significant nerve damage.
"Fortunately, he's awake. He was coherent. He's OK," Ross said.
The shooting caught the attention of Pennsylvania Gov. Tom Wolf, who said he is "thankful that Officer Hartnett is alive and not facing life-threatening injuries after being ambushed."
"We wish him and his family the best during his recovery. This alleged intentional act of violence against an officer seeking to help a fellow citizen is horrifying and has no place in Pennsylvania," he said.