An off-duty correction officer sprung into action when a gunman fired into a crowded Queens sidewalk Sunday morning, police said.

The officer with the city’s Department of Correction saw an unknown man fire several gunshots into a crowded area around 2 a.m. in front of Peter Cooper Florist, Inc. at the corner of Steinway Street and 28th Avenue in Astoria, police said. He also fired shots into the air, law enforcement sources said.

After firing into the crowd, the gunman spotted the off-duty officer and began charging at him, prompting him to fire at the unhinged man, police sources said. He was unable to stop the shooter from running off westbound on 28th Avenue, police said.

Police recovered 11 shell casings at the scene. The gun has not yet been found, police said.

No one was injured and cops are still looking for the gun-toting man. No arrests have been made and the investigation is ongoing.

“We are aware of this report, and we are looking into this,” said spokesperson Deputy Commissioner of Public Information Peter Thorne in an emailed statement to the Post.