A US court convicted a man of possession of cocaine, and the judge sentenced him to 15 years in jail before the case was withdrawn when it was found that he had powdered milk.

Cody Gregg, 26, of Oklahoma, was sentenced to 15 years in prison last week after pleading guilty to possession of cocaine for distribution, according to court records. He pleaded guilty after his arrest in August and was charged with illicit drug trafficking.

After the lab report showed a negative result of the illegal drugs, the defendant withdrew his confession, and the Oklahoma District Judge approved the request to withdraw the case, according to "Mercury News."

Greg told the judge that the milk powder was from a local food store.He said he was riding his bike when a police officer stopped him because he had no back lights.Then he jumped off the bike and ran away, and officers found the white powder in his backpack that he left behind.

The newspaper reported that the judge released Greg, after being held since his arrest last August.