Medics took the man to Brooklyn Hospital in critical condition; he was identified by a family member as Nasheem Prioleau.

The two officers went to Methodist Hospital for evaluation, but an NYPD spokeswoman said they were unharmed.

It’s not clear if Prioleau actually hit whoever he was first targeting before police arrived, the spokeswoman said.

Police sources said the gunman is a known Bloods member who goes by the street name “Trigger,” and was involved in four other shootings in the 76th Precinct alone.

Family members at the hospital confirmed that he had been released from prison days ago

Prioleau was just released to parole on Oct. 10, after his conviction in 2014 on attempted robbery charges, public records show. He also served time for attempted weapon possession in 2008 and attempted assault in 2011, records show.