SAN JOSE (CBS SF) — A gang member has been charged with assaulting two San Jose police officers in a weekend altercation that involved a desperate struggle for an officer’s gun, authorities said.

San Jose police said 22-year-old Rodel Pulido was being held on charges that include two counts of assaulting a police officer with a firearm and felony resisting or deterring and officer with force.

“If you attack a police officer, you threaten the lives of everyone in our community,” District Attorney Jeff Rosen said. “My Office will prosecute these despicable and incredibly dangerous crimes to the fullest extent of the law.”

The incident took place at 6:42 p.m. on November 27 when the officers pulled Pulido over for a traffic violation on the 500 block of Avalani Ave.

When the officers asked Pulido to step out of the car, he refused as other officers were arriving at the scene.

He eventually exited the vehicle, but continued to be uncooperative. Pulido also made several calls while inside and outside of the car and a crowd began to gather at the scene.

Officers decided to place Pulido in handcuffs for safety reasons while they continued the investigation. He immediately became resistant and pulled away from officers.

A struggle ensued with Pulido grabbing an officer’s holstered pistol. The specialized holster prevented Pulido from removing the pistol, but he was able to maneuver the holster in the direction of an officer and fire a single round.

Fortunately, the bullet entered and exited the pants of one officer but did not break his skin. The round or ricochet then grazed another officer in the lower, right thigh. He was treated at a local hospital and released.

Pulido was then struck with a Taser three times and taken into custody.

After the arrest, police found a loaded .40 caliber untraceable “ghost gun” under the driver’s seat. Detectives also located a large amount of cocaine, a scale, and thousands of dollars in cash.

Pulido was set to be arraigned on the charges on Wednesday afternoon. If convicted, Pulido could face a long prison sentence.