NEW YORK (CBSNewYork) — Police subdued and arrested a man who allegedly ran from officers and fired a gun at them in Bushwick, Brooklyn Thursday morning.

Officers Essig and Palminteri, of the Street Narcotics Enforcement Unit of the 83rd Precinct in Brooklyn, were dispatched to investigate a drug deal that had gone down at Garden Street and Flushing Avenue.

READ MORE: Police: Gunman Arrested In Deadly New Year's Shooting Of 20-Year-Old Robert Williams At Queens Hotel

The officers walked toward the scene and approached the person involved to investigate, police said.

Police said the man ran from the officers, who chased him on foot. About four blocks later, the suspect reached into his waistband, turned around and fired a shot from a handgun at the officers as they chased him close behind, police said.

A New York Daily News report said the shot the man fired struck a bystander’s van. The bystander – identified as Osvaldo Valdez — joined the officers in the chase and pushed the gun aside when it fell out of the suspect’s hands as he struggled with the officers, the newspaper reported.

READ MORE: NYPD Looks To Question Rahmel Howard After Broad Daylight Home Invasion On Staten Island

The suspect was immediately subdued and arrested in front of 480 Bushwick Ave., police said.

Suspect Darren Moore, 25, of Brooklyn, was charged with aggravated attempted murder of a police officer, criminal sale of a controlled substance, criminal use of a firearm, criminal possession of a weapon, and resisting arrest.

A Browning .380 semi-automatic weapon was recovered.

MORE NEWS: Long Island's South Shore Under High Wind Warning As Nor'easter Wraps Up

Neither the officers nor the suspect were injured, police said.