A Brooklyn man shot an NYPD officer in his ballistic vest and grazed another in the leg during a standoff with police after he wounded his roommate at their apartment late Sunday, officials say.

The 44-year-old suspect was taken into custody following the clash with police who responded to a call from his wounded roommate, police sources told the New York Post.

The roommate dialed 911 from their apartment.

The officer was hit in his vest as officers arrived at the apartment shortly after 9 p.m. and the suspect fired through the door, the sources said. Another officer was grazed in the leg, police said.