It happened around 9 p.m. Wednesday on the 2900 block of West Dauphin Street.
According to police, plainclothes officers from the 22nd District were in an unmarked Chevy Impala and had spotted a vehicle driving erratically and violating traffic laws. They called for a marked police vehicle to pull it over.
A marked police SUV arrived and drove right behind the unmarked police vehicle, both following the erratic driver.
Around 30th and Dauphin streets, police say, a man got out of the car and fired at least 11 shots at the officers' unmarked vehicle, which was hit at least five times.
One of the bullets struck the windshield of the Impala.
Shards of glass struck the face and neck of the officer in the passenger seat. He was taken to the hospital and received stitches.
"He's in stable condition. He's fine, but he's extremely lucky because the one bullet went through the center of that front windshield; either of these officers could have been struck by gunfire," said Philadelphia Police Chief Inspector Scott Small.
Police believe they know who they are looking for.
"Just before this happened, the officers were able to give a description of the vehicle as well as a license plate number to police radio, so we already have several leads as to who this vehicle belongs to and the address this vehicle is registered to," said Small.
Police did not open fire.
"This happened so quickly that the officers took cover inside the vehicle, and they were able to put the vehicle in reverse, and then they put out the information and description of the vehicle the perpetrators were in," Small said.
Anyone with any information is asked to call police at 215-686-TIPS.