An NYPD detective shot in the back Sunday morning in Brooklyn appears to have been struck by one of his fellow officers, officials with the department said Monday.

The detective was one of several NYPD members who engaged an 18-year-old suspect, allegedly armed with a firearm when he approached their unmarked police car around 4 a.m. in Crown Heights.

The shooting occurred near the intersection of Nostrand Avenue and St. John’s Place.

“Given the lack of body-worn camera in this incident, the circumstances of the approach are still unclear. But we can say officers exited their vehicle and attempted to engage the armed individual,” Commissioner Jessica Tisch said Sunday at an NYPD briefing. She stood alongside Mayor Zohran Mamdani and members of the detectives’ union.

At least three officers fired, she said, but none struck the 18-year-old. He the allegedly ran from the NYPD officers for several blocks until they caught up and Tased him.

A firearm allegedly belonging to the suspect was recovered, the commissioner said.

During the gunfire, Detective Robert Karroll was struck in the back of his bulletproof vest. He and another officer were taken to a nearby hospital to be treated for contusions, Tisch said.

On Monday, the NYPD said Karroll “was shot once in the back of the best by what appears to be friendly fire.”

Police have not publicly said whether the suspect fired at the officers, but the commissioner said their vehicle had multiple bullet holes in the front and passenger side.

According to Monday’s update from the NYPD, the 18-year-old did allegedly fires his gun at a moving car several minutes before ultimately engaging with police. The car was an uber and had a passenger inside when it was struck, police said.