Police have apprehended three men who were allegedly shot at undercover police officers in Brooklyn, the NYPD said. 

At around 10:45 p.m. on Wednesday, three NYPD officers in an unmarked department vehicle observed a dispute among three men in Fort Greene near Park and North Portland avenues.

When the officers turned around, two suspects opened fire on the car, missing all three officers, according to a related report by ABC7 New York.

RELATED: Brooklyn cops find gun in fake Bible case

The officers returned fire and observed the suspects fleeing the location on foot, according to the NYPD. A .45 caliber Sar Arms firearm was recovered under the tire of a nearby vehicle.  

A search of area hospitals resulted in the discovery of a 23-year-old male who arrived at Beth Israel Hospital with a gunshot wound to the left leg; he remains in stable condition and is now in custody, police said. The other two suspects were taken into custody on Thursday morning without incident.