NEW YORK (CBSNewYork) — An NYPD officer is in stable condition at a hospital after being hit by gunfire late Sunday night.

The officer was shot in the chest, but, fortunately, he was wearing a bulletproof vest, CBS2’s Kiran Dhillon reported.

READ MORE: Some Calling For Vicious Acid Attack On Long Island Woman To Be Investigated As A Possible Hate Crime

Police said a second officer was grazed in the leg and was also in stable condition.

The officers were wounded while responding to a report of a male shot inside of a building at 42 Hawthorne St. in Prospect Lefferts Gardens, Brooklyn, just after 9 p.m.

Police said when officers approached the apartment a gunman came out and discharged a firearm. He then barricaded himself inside the apartment with another man and a woman.

READ MORE: Family, Friends, Community Lay Daunte Wright To Rest In Minneapolis

The gunman was eventually taken into custody.

The officer shot in the chest was said to be conscious and alert as he was taken to Kings County Hospital.

CBS2’s Kiran Dhillon contributed to this report

MORE NEWS: Brooklyn Resident Ali Prato, Texas Woman Blair Nelson Create Support Community 'Infertility Rally' To Let Others Know They're Not Alone

Please stay with CBS2, CBSN New York and CBSNewYork.com for more on this developing story.

CBSNewYork Team