A polite, but unlucky, drugs suspect has found himself in more trouble after he doffed his hat to the female judge - only for cocaine to fall out in the middle of the courthouse.

Juan Jose Vidrio Bibriesca, originally of Mexico who was in the country illegally, was at Eagle County District Court on November 8 for a bond violation on felony drug charge.

The 43-year-old had just taken a stand on the podium in front of Judge Katharine Sullivan, when he decided to do the gentlemanly thing and removed his hat.

Juan Jose Vidrio Bibriesca, (pictured) originally of Mexico who was in the country illegally, was at Eagle County District Court on November 8 for a bond violation on felony drug charge

Unfortunately for him, as he swung his hat behind his back, an eagle-eyed police officer noticed a small square of folded paper fall from it to the ground.

That paper was later found to contain cocaine. Court room surveillance cameras confirmed the tiny package had come from Bibriesca's hat.

Bibriesca was almost immediately taken next door to the county jail where he received two new charges; narcotics possession and another bond violation.

Booking documents don't indicate if he has hired an attorney.

It is not clear whether he has been approached by Immigration and Customs Enforcement yet.

The 43-year-old had just taken a stand on the podium at Eagle County District Court (pictured) when he decided to do the gentlemanly thing and removed his hat