Five-year Philadelphia Police Department veteran Jesse Harnett is made of stronger stuff than most people.

Harnett was flagged down by Edward Archer last night, and as he stopped his car, Archer opened fire with what appears to be a Glock 19, a 9mm pistol, from just 3-4 yards away. A security camera caught Archer advancing as he fired, with his final shots being fired at point blank range through the squad car window in an obvious assassination attempt.

Instead of  putting up his hands and turning his head away from the fight as many people would have instinctively done, Harnett instead drew his own weapon and fought for his life.

A police officer in a patrol car was wounded overnight in a blazing ambush in West Philadelphia during which a gunman unloaded a semiautomatic pistol into the cruiser, authorities said.

Officer Jesse Hartnett, 33, was hit three times in the arm and taken to Penn Presbyterian Hospital, where he was reported in stable condition but faces a long recovery, authorities said.

The suspect gunman, identified by sources as Edward Archer, 30, of Yeadon, also was wounded by return fire from Harnett and taken into custody after attempting to flee, police said. Officers also recovered a black, 9mm semiautomatic pistol.

The shooter in the attack is seen wearing Muslim garb – a long white robe over dark pants – on surveillance video, according to police sources, but officials have not said if they believe religion was a factor.

Mayor Kenney and Police Commissioner Richard Ross, both only in their first week in their jobs, rushed to the hospital after the shooting around 11:30 p.m. at 60th and Spruce Streets.

Ross said the officer was driving north on 60th Street when he was flagged down by a man in the street who was wearing multiple layers of clothing.

The man opened fire 13 times, pocking the cruiser with bullets before firing into the driver’s side window, hitting the officer’s arm three times, Ross said.

Although wounded, the surveillance video shows Hartnett getting out of the car and chasing his assailant, according to sources. The officer squeezed off three rounds, hitting the suspect, and radioed for help.

Officers caught Archer on the 6000 block of Delancey Street.

Harnett has a long road of recovery ahead of him, but is expected to survive.

Like so many thugs, Archer has a criminal record of violence with weapons, and was due to be sentenced Monday on other charges.

Archer’s mother says that she’s holding out hope that they arrested the wrong man, and I’m sure we’ll be hearing from her soon that he was a “good boy” who was “starting to turn his life around.”

Update: Philadelphia police commissioner Richard Ross said that Harnett’s “will to live” is the reason he is alive today. Archer has confessed to the crime and said that his allegiance to the “Islam State” is the reason for his attack.

The Glock 19 pistol used in the crime was stolen from the Philadelphia Police three years ago.