(CNN)A Philadelphia police officer is recovering after being dragged for five blocks while hanging out of a vehicle as the driver attempted to flee, according to an incident report.
"The officer is extremely lucky," Philadelphia Police Chief Inspector Scott Small told CNN affiliate KYW.
Authorities were questioning a male driver during a traffic stop Tuesday evening in West Philadelphia when they spotted a gun, police said.
"When officers questioned him about the gun, the male immediately reached for the gun, that's when police reached for that arm," Small said.
The driver pressed the gas pedal and drove five blocks with an officer hanging out of the vehicle, police said.
The vehicle took off "while the officer was holding on for his life and also holding on to the gun that this driver had in his right front pocket," Small said. "The entire time, dragging the police officer, who was partially inside of the vehicle, laying on the driver with his upper body, and his legs were hanging out of the driver door."
Another officer can be heard on police dispatch audio requesting help and telling his colleagues where to find them.
"My partner's stranded inside the vehicle," a male officer can be heard saying. A dispatcher can be heard asking for the location and alerting others.
"I believe we have an officer trapped inside of a vehicle," the dispatcher said. She adds later, "Be advised. Rescue's being called now."
The vehicle drove for about a half a mile before crashing into two other vehicles.
The officer was shaken up, Small said, and had a cut on his neck and some bumps and bruises.
The driver was arrested and was being processed, according to department spokesman Miguel Torres. A gun was recovered at the scene, police said.
CNN has reached out to the Philadelphia Police Department for additional comment.