An overnight traffic stop escalated into a police-involved shooting when a suspect sped off with an officer inside his vehicle and others in pursuit.

Just before 11 p.m. on Wednesday, police on Hollis Avenue near 212th Street in Queens stopped a silver Mercedes Benz for traffic violations, police reported. The driver, though, refused an officer’s order to put the car in park after police had approached the vehicle.

RELATED: Cops shoot, kill man after he allegedly reaches for gun in Queens

A sergeant opened the passenger door and attempted to engage the driver -— identifed by police as Ramell Lockwood, 34, of Hempstead, Long Island -— but he sped off with the officer inside his car, according to authorities.

The driver, with the sergeant, headed east on Hollis Avenue, but was forced to stop by pursuing officers at 217th Street, police stated. Inside, the sergeant struggled with the driver, who got out of the car and revealed that he had a firearm.

The sergeant shot the man in the leg, and he was taken into custody by the responding officers after a struggle, authorities reported. A loaded semi-automatic handgun was recovered from the suspect.

RELATED: Possible rooftop shooting almost kills woman, 2 small children in Queens

One officer was allegdly bitten by Lockwood as he was apprehended, according to police. Five officers and the suspect, in stable condition, were taken to area hospitals for treatment.

Lockwood has been charged with assault, criminal possession of a weapon, menacing, reckless endangerment and resisting arrest, police added.