NEW YORK — An off-duty NYPD officer who was shot in the foot in Harlem Saturday afternoon has been released from the hospital, police said Sunday.

The officer, who was listed in stable condition after the shooting, was released overnight, the NYPD said. He was shot outside the community center of the Manhattanville housing development at 3250 Broadway, near West 131st Street, around 4:30 p.m., police said.

NYPD Chief of Housing Jeffrey Maddrey on Saturday said the officer was attending a vigil for a revered community member who passed away.

According to the NYPD, the officer left the lobby of the building, saw two people start firing rounds from a gun and dove for cover.

Police said he later felt pain in his foot while assisting with the investigation and was examined in an ambulance, which is where he discovered he had been shot in the foot.

The officer was taken to Mount Sinai Morningside hospital after the shooting. Maddrey said he was expected to make a full recovery.

No arrests have been made. Maddrey said police are interviewing witnesses and looking at video, and asked anyone with information on the case to call the NYPD’s Crime Stoppers hotline at 1-800-577-TIPS.

The shooting marked the seventh time an NYPD officer has been shot this year.

On Tuesday, an off-duty officer was hospitalized after he was shot in the shoulder during a robbery attempt in Queens, police said.

And Detectives Jason Rivera and Wilbert Mora died after they were shot in Harlem last month.