A Brooklyn man accidentally shot himself in the groin after cops spotted him urinating in the street early this morning.

Cops say the incident happened around 1:15 a.m. Saturday morning, when they spotted the 26-year-old man standing on the northeast corner of E. 93rd Street and Clarkson Avenue in East Flatbush peeing. As the officers approached the man, they heard a gunshot.

It turned out that the man, whom the News has identified as Javier Thomas, was trying to get rid of his 9mm Glock when he mishandled it and accidentally shot himself in the groin. The suspect was taken to Kings County Hospital in stable condition. Charges are pending.