NYPD detectives arrested two teens Friday in connection with the shooting of an off-duty officer who was struck in the foot in Harlem last week.

Police charged a 17-year-old and 16-year-old boy, both of Harlem, with attempted murder about 4 p.m. Friday, NYPD officials said.

The 17-year-old was also charged with assault with a deadly weapon and criminal possession of a weapon.

The teens were not publicly named because they are minors, and it’s unclear if they will be tried as adults or in juvenile court.

The off-duty officer, who is assigned to the Bronx, was shot on Feb. 5 outside the Manhattanville Community Center in Harlem, NYPD officials said. The officer was attending a vigil "for a very revered community leader" when the shooting occurred.

When the officer left the lobby of the center, he saw two people fire rounds from a gun, police said. As he saw the gun fire he dove for cover and the two teens ran away. The officer did not fire his weapon.

Police believe the officer was not the intended target and that the shooting may have been connected to an argument about two hours earlier in the lobby of the community center.

The off-duty officer gave responding officers a description of the suspects but didn’t immediately realize he had been shot. He soon felt pain in his left foot and was taken by ambulance to Mount Sinai Morningside Hospital to be treated for two gunshot wounds.

The officer was not identified, and he was released from the hospital the next day.

The NYPD officer was the seventh shot this year, including Harlem police officers Jason Rivera and Wilbert Mora, who were killed responding to a domestic dispute at a Harlem apartment.

"The whole city is thankful this incident wasn’t much worse," NYPD Chief of Housing Jeffrey Maddrey said after the shooting. "I want to make a plea to the community: We have to stop the scourge of gun violence. We shouldn’t have to live like this."

On the latest episode of "Sarra Sounds Off," Gregg talks with Michael Sicoli and Tess Ferguson about county champs crowned in boys and girls lacrosse, and Jared Valuzzi reports on the Long Island flag football championship. Credit: Newsday

Sarra Sounds Off Ep 36: Champs crowned in lax and flag football On the latest episode of "Sarra Sounds Off," Gregg talks with Michael Sicoli and Tess Ferguson about county champs crowned in boys and girls lacrosse, and Jared Valuzzi reports on the Long Island flag football championship.

On the latest episode of "Sarra Sounds Off," Gregg talks with Michael Sicoli and Tess Ferguson about county champs crowned in boys and girls lacrosse, and Jared Valuzzi reports on the Long Island flag football championship. Credit: Newsday

Sarra Sounds Off Ep 36: Champs crowned in lax and flag football On the latest episode of "Sarra Sounds Off," Gregg talks with Michael Sicoli and Tess Ferguson about county champs crowned in boys and girls lacrosse, and Jared Valuzzi reports on the Long Island flag football championship.

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME