Authorities in New York state said a man searching his pockets for a summons in a courtroom dropped a bag of marijuana onto an officer's shoe.

Nassau County District Attorney spokesman Eric Phillips said Desmond Kelly, 28, was being arraigned at First District Court in Hempstead, N.Y., on a motor vehicle violation when the judge asked Kelley if he had the original traffic ticket, the New York Post reported Thursday.

Phillips said Kelly "reached into his pocket and took out the ticket. At that time, a small bag of marijuana fell out and landed on top of the shoe of a court officer."

The spokesman said the officer shouted "'You're under arrest!' and the audience in court gasped."

Kelly was immediately arraigned on the drug possession charge.