Police officers shot and wounded a man after he allegedly opened fire on a man walking in East Harlem, then pointed his weapon at police officers.

The shooting happened around 8 p.m. on Tuesday in the area of East 101st Street and First Avenue. Police said the suspect, later identified as Wilvinson Diaz, was spotted by officers with the NYPD's Special Victims Unit running up behind a 21-year-old man, and shooting him in the torso and leg.

Diaz, 26, allegedly chased the man up First Avenue, when he ran into two detectives who ordered him to drop his gun. 

The NYPD says Diaz was shot after he pointed his gun at the officers. The detectives shot Diaz twice in the torso, and he was taken to Harlem Hospital, where he is in stable condition. 

No police officers were injured. 

Diaz was arrested on numerous charges on Wednesday, including attempted murder, possessing a firearm and reckless endangerment. A .22 caliber gun was found at the scene.