In surveillance video obtained exclusively by Action News, the suspect can be seen walking down North D Street right around 4:00 p.m. Monday.
When he crosses the road, a squad car rolls up along side of him.
Not long after the suspect sees the police car, he pulls out a 32 caliber Beretta and opens fire.
The police car is struck twice.
"Once in the driver door and once in the driver side rear door, almost hitting the officer in the head. The officer is very lucky to be alive," Philadelphia Police Chief Inspector Scott Small said.
The female officer, a 9-year veteran of the force, returned fire striking the suspect twice, grazing his head with one shot and the other hitting him in the chest.
It all happened right in front of Charles Schoffler's home.
"First I heard three shots, then she drew her gun, she shot, and I look and said 'he's down,'" Schoffler said.
Investigators believe the suspect was behind an attempted robbery and shooting a short time earlier on the 500 block East Hart Lane.
Police responded to that scene where they found a 37-year-old woman shot in the stomach.
The officer slowed down as she approached the 27-year-old suspect on D Street because he matched the description of the gunman given by witnesses of the East Hart Lane shooting.
Action News has learned that the shell casings left behind in both crime scenes are identical.
Both the robbery victim and the suspect are at Temple University Hospital in critical condition.
Charles Schoffler says he can't help but wonder if he'll ever feel safe again in his own neighborhood.
"You just have to take care of one another around here," Schoffler said.