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: Gov. Cuomo Under Fire Over Remarks About Sexual Harassment: 'Harassment Is Not Making Someone Feel Uncomfortable'

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: NYPD Surprises 4-Year-Old Times Square Shooting Victim With New Toys, Visit From Minnie Mouse

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: Bronx Man Takes It Upon Himself To Clean Up NYC Park, But City Says Not So Fast

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

CBSNewYork Team