Associated Press

NEW YORK — A police officer craving for cake batter ice cream put him and his colleagues in the right place to take action when a loaded gun fell out of a man's shorts at a Baskin-Robbins shop in New York City.

Police say three on-duty officers were at the shop Saturday in Coney Island, Brooklyn when Emmanuel Lovett walked in, tugged his denim shorts and dropped a pistol to the floor.

The officers swarmed and arrested the 33-year-old man. Police say his robbery record prohibited him from having a gun. He's charged with criminal possession of a firearm.

Lovett is jailed on $7,500 bail. He's due in court Friday. A message seeking comment was left with his lawyer.

Love ice cream? 18 iconic flavors we wish would come back

The NYPD acknowledged the oddity of the ice cream-induced arrest, tweeting: "Seriously, this actually happened."