The NYPD officer who was shot in the back on a Brooklyn street early Sunday morning may have been hit by friendly fire, an NYPD spokesperson said.

The officer, Detective Robert Karroll, was shot in the back of his protective vest shortly after 4 a.m. on Nostrand Avenue near St. John’s Place in Crown Heights as he and other officers confronted an armed suspect, NYPD spokesperson Brad Weekes said Monday.

The shooting happened after the suspect, an unidentified 18-year-old, was captured on video footage pulling a handgun on someone outside of a nearby deli, Weekes said.

Minutes later, at about 4:10 a.m., the teen then fired at an Uber that was driving down the street, Weekes said. A bullet struck the car, but the driver and passenger were not injured, according to the NYPD.

The suspect, still carrying the gun in his hand, then walked past the unmarked police car where Karroll and other officers were sitting, according to Weekes. The officers spotted the gun in his hand and began firing at him, according to the NYPD.

Karroll appears to have been hit by a shot fired by a fellow officer in the shooting, Weekes said in an email.

The officers did not activate their body-worn cameras during the shooting, “presumably because it happened so quickly and unexpectedly,” NYPD Commissioner Jessica Tisch said at a press conference after the shooting.

Officers chased the teen suspect and arrested him blocks away on Rogers Avenue and Union Street, Tisch said at the press conference. The teen has not been identified and charges against him have not yet been made public.