BROOKLYN - Police shot and wounded a man who allegedly opened fire on them as they investigated a shooting.

Investigators say the incident unfolded shortly after 1 a.m. Friday. Two plainclothes officers found a 52-year-old man who had been shot in the arm outside of a home on Madison Street. The victim provided a description of the gunman.

The officers caught up to the suspect, identified as 27-year-old Jerrol Harris, of Brownsville, on Jefferson Avenue between Evergreen and Bushwick.

That's when officers say Harris turned and fired two shots at them. The shots missed, and instead struck their unmarked police car.

The officers chased Harris on foot and were joined by other officers. He was eventually shot in the leg and was then taken to Kings County Hospital. Police say they seized Harris' weapon at the scene.

Authorities say Harris faces charges for shooting the 52-year-old man, and for allegedly firing at the officers. He is expected to be charged with attempted murder of a police officer and menacing an officer, in addition to a charge of criminal weapon possession.

The victim who was originally shot was taken to Elmhurst Hospital in stable condition. Six officers were also treated for ringing in the ears.