An off-duty state court officer fatally shot a man who allegedly tried to mug him outside of a Dunkin' Donuts in Queens Sunday night. According to police, the 50-year-old officer was en route to his second job as a security guard when he was approached by an unidentified man near the corner of Merrick Boulevard and Liberty Avenue in Jamaica.

After the assailant allegedly brandished a gun and attempted to rob him, the court officer drew his service weapon and opened fire, striking the man in the torso, an NYPD spokesperson confirmed. Sources told the Daily News the officer's gun was clearly visible in its holster, and the officer had been walking to his car as the man approached. The tabloid also reports the would-be robber was in his 20s and had allegedly demanded the officer give up his gun.

Emergency responders rushed the injured man to Jamaica hospital, where he later passed away.

The court officer was taken to North Shore University Hospital in Manhasset where he was treated for chest pains and later listed in stable condition. According to the police, the incident is being investigated by the Queens District Attorney's office.