NEW YORK - An NYPD officer was struck in the armpit, and a suspect was killed, in a shooting Thursday in Manhattan, the police department said.

It happened sometime before 4:30 p.m. at the intersection of Wadsworth Avenue and West 187th Street in Washington Heights.

After responding to 911 calls and a ShotSpotter activation, officers observed and approached a man who matched the description from a 911 call, according to authorities.

The NYPD said the suspect ran north of 187 Street towards a garage with a gun in his hand and hid behind the last parked car in a parking lot. An officer pursued the suspect and crouched behind a vehicle three cars away. The suspect then fired three rounds, striking the officer once, police said.

Shortly afterwards, the NYPD said, the suspect shot once at a plainclothes officer from the Anti-Crime Unit who responded to the scene, nearly hitting him. That officer then fired three shots, striking the man once in the chest.

"This is the 34 precinct anti-crime car and this is the bullet hole in the windshield. And the police officer was standing right next to it when it was fired. I saw the video, it just missed him," said NYPD Commissioner James O'Neill.

"This is a situation that here we are talking about broad daylight something happening out of nowhere. These officers did everything right to protect the people of this community," said Mayor Bill de Blasio.

The suspect was transported to New York-Presbyterian Hospital and pronounced dead at 5:10 p.m. His identity has not been released as of this writing.

The officer's injury was not considered life-threatening, and he was transported to St. Luke's Hospital.

A gun was recovered from the scene of the shooting, officials said.