An off-duty NYPD officer shot and killed a man during a Craigslist robbery gone awry. 

The police officer arranged to meet a seller on 145th Avenue in Springfield Gardens, Queens, to inquire about a white BMW listed for sale on Craigslist, Pix 11 reported, adding that two men arrived and showed the officer the car before one man allegedly pulled a gun on the officer. The suspects then took the officer's wallet, cops said.

RELATED: Off-duty police officer stabbed in Queens park: NYPD

In response, the officer pulled his own gun and fired several rounds, hitting the robber with the pistol in the torso and leg, police said.

The wounded suspect, identified as 30-year-old Devon Holder of Brooklyn, was taken to Jamaica Hospital, where he died, police said, who added that his accomplice fled in the white BMW and remained at large.

“[The officer] was standing there with a gun in his hand, pointing it at the body,” a 20-year-old witness told the Daily News. “It’s a good thing. [The officer] could have been the guy on the floor.”

RELATED: Off-duty officer struck twice in attempted carjacking in Brooklyn: NYPD

Cops found the suspect's black air pistol at the scene, police said.