ASTORIA, Queens (PIX11) — An off-duty NYPD officer came under gunfire on an Astoria street early Wednesday, according to the authorities.

The cop was getting out of his car near 23rd Street and 28th Avenue around 1:40 a.m. when two men wearing black hoodies hopped out of a black sedan and approached him, officials said.

As the victim turned around, one of the men opened fire in his direction, before the pair got back in their car and fled, police said. The cop was not struck by the shots, though one round did hit a nearby window.

Investigators had not announced an arrest as of early Wednesday.

The incident came less than 24 hours after an off-duty detective exchanged gunfire with a man on a street in the Rosedale section of the borough.

Submit tips to police by calling Crime Stoppers at 1-800-577-TIPS (8477), visiting crimestoppers.nypdonline.org, downloading the NYPD Crime Stoppers mobile app, or texting 274637 (CRIMES) then entering TIP577. Spanish-speaking callers are asked to dial 1-888-57-PISTA (74782).