JERSEY CITY - Two Jersey City police officers are recovering after a struggle with a suspect that could have had a tragic ending.

The officers attempted to make a traffic stop in the area of Kearney and Bergen avenues at around 12:45 a.m. Tuesday. When they approached the gray Mercedes, they noticed a handgun in the suspect's possession and tried to arrest him, according to Assistant Hudson County Prosecutor Gene Rubino.

The suspect, identified by police as John Windley, 34, allegedly tried to flee the scene with both officers still hanging onto the car.

Both officers fired their weapons, but no one was struck by the gunfire, Rubino says.

One of the officers fell from the vehicle. The second managed to climb in through the sun roof and struggled with Windley as he crashed into a chain link fence and finally stopped at the corner of Bergen and Boyd avenues.

"I don't know how, the car was going pretty fast," says witness Craig Ballon. "Probably, definitely, going 45 or 50 and he was holding on."

Windley then allegedly fled on foot and tossed the semi-automatic handgun and ammunition as he ran.

Rubino says Windley was quickly captured by Jersey City police, and the handgun was recovered.

Windley was charged with attempted murder, eluding, resisting arrest and various weapons charges.