A man who appeared in an Ohio court due to a traffic ticket now faces jail time after a bag of cocaine fell out of his baseball cap and onto the floor.

The incident took place during a court session in mid-April as 39-year-old Lemar Reed, of Lorain, walked up to enter a plea for a minor traffic violation.

CCTV footage captured Reed holding his cap. As he lifted it up, a small bag of a white powder fell to the ground.

Nobody – including Reed – appeared to notice. That was until a courtroom security officer noticed the sack of narcotics on the floor about an hour later.

"He picked it up, looked at it, and saw a white powdery substance," Lorain Municipal Judge Mark Mihok told Fox 8 News. "We had it field tested by the Lorain Police Department and it tested positive for cocaine."

The bag contained less than a gram of cocaine, according to reports.

While cocaine in the courtroom is a first for Mihok, the judge said it is a frequent occurrence and commended Manuel Brillon, the security officer who spotted the drugs.

Taking his hat off to the man responsible for the find, Mihok said: "There is nonsense like this going on all the time in courtrooms, and this just shows the importance of security officers in courtrooms."

The judge added: "[Brillon] did a great job."

A warrant was swiftly issued for Reed's arrest.

"He was only here for a traffic ticket," said Mihok. "He made a simple traffic ticket with only the penalty of a fine into a felony. So, not a good day for him."