An off-duty corrections officer shot and killed a man who allegedly tried to rob him at gunpoint in Queens.

Police say the man walked up to five other men on Rockaway Boulevard around 10:30 p.m. Saturday, flashed a gun and demanded the keys to their motorcycles.

One of the five—an off-duty state corrections officer—shot the would-be robber once in the head.

He was pronounced dead at Jamaica Hospital.