An 18-year-old gunman has been charged with attempted murder in connection to the Brooklyn friendly-fire shooting of an NYPD detective who was struck in his bullet-resistant vest, police said Tuesday.

Camani Bartletto is charged with attempted murder — for allegedly firing at an Uber shortly before the detective was shot — along with gun possession, reckless endangerment and criminal mischief.

The wounded cop, Det. Robert Karroll, a 20-year veteran, escaped the harrowing 4:12 a.m. Sunday encounter at Nostrand Ave. and St. John’s Place in Crown Heights with a bruise.

Karroll, a married father of three, was in uniform along with three other officers sitting in an unmarked NYPD SUV when the gunman approached, walking past on the driver’s side, then crossing in front of the vehicle, police said.

Teen gunman arrested for attempted murder in connection to friendly-fire shooting of NYPD cop
Shell casings are marked on the sidewalk near an unmarked NYPD vehicle after a detective was shot early Sunday on Nostrand Ave. and St. John’s Place in Brooklyn. (Theodore Parisienne / New York Daily News)

Three of the four officers fired at the gunman, police said, with one shot striking Karroll in the back, the bullet lodging in his vest.

Bartletto, who was not shot, ran off but other officers chased him down near Rogers Ave. and Union St. and subdued him with a Taser, NYPD Commissioner Jessica Tisch said at press conference at Kings County Hospital, where Karroll was treated and released. A second officer was treated for minor injuries.

Bartletto dropped his 9mm handgun as he tried to get away but it was recovered by cops.

Tisch said the incident unfolded so quickly the officers did not have time to turn on their body-worn cameras.

(The black unmarked NYPD Kia SUV seen here was observed with a bullet hole in the front windshield, the rear windshield and the rear driver side window) NYPD Detective Robert Karroll was taken to Kings County Hospital after he was shot in the back during a shootout with an armed 18yr old male teenager who approached their unmarked black Kia SUV and opened fire as he and other Officers were parked on Nostrand Avenue near Saint John's Place in Brooklyn on July 5th, 2026. 0932. Officers returned fire but the teen was not struck. The teen was chased down and placed under arrest a few blocks away. NYPD Commissioner Jessica Tisch stated that the bullet struck the bullet proof vest being worn by Detective Karroll and that this saved his life. (Theodore Parisienne / New York Daily News)
Bullet holes are seen in an unmarked NYPD vehicle after a detective was shot early Sunday on Nostrand Ave. and St. John’s Place in Brooklyn. (Theodore Parisienne / New York Daily News)

But based on evidence, including other video, police said the gunman about seven minutes before Karroll was shot was seen pointing a gun at someone outside a deli on Nostrand Ave. before going inside, then leaving and shooting at a passing Uber, striking the vehicle.

Neither the driver nor the passenger was hurt.

Karroll is normally assigned to the NYPD Sex Offender Monitoring Unit. He and the other officers were working on a Fourth of July detail aimed at reducing crew violence in the area when they spotted the suspect.

Bartletto lives in West Orange, N.J., according to cops. He has a prior petty larceny arrest in New Jersey but no arrest record in New York City, cops say.