A uniformed NYPD cop was shot three times — including once in the bulletproof vest — while responding to a report of gunfire in Brooklyn on Wednesday night, sources said.

The officer, who is expected to survive, and his partner were near Macon Street and Howard Avenue in Bushwick for a ShotSpotter alert when they encountered a suspect who fit the description of the shooter at about 11:15 p.m., police sources said.

When the cops told the suspect to stop, he turned around and opened fire, striking one of the officers in the back portion of the bulletproof vest, the buttocks and the back of the leg, sources said.

CALIFORNIA POLICE OFFICER KILLED WHILE RESPONDING TO DOMESTIC CALL, LEAVES BEHIND FAMILY, INCLUDING BABY 

The suspect also suffered a gunshot wound in the confrontation, though it wasn’t immediately clear if the cops opened fire, according to sources.  

He was taken into custody, according to sources.

Both the suspect and the injured officer, who has four years on the job, were taken to Kings County Hospital, sources said.

The officer was listed in serious, but stable condition, sources said.

The suspect’s condition was not immediately known.