Homeless man sentenced to 15 years for cocaine possession — then a lab proved it was powdered milk

A homeless man who pleaded guilty to possession of cocaine with intent to distribute was sentenced to 15 years by an Oklahoma court, only to have the case dismissed after the substance in his possession was revealed to be powdered milk.

Cody Gregg, 26, pleaded guilty to possession of cocaine with intent to distribute on Oct. 8 and was sentenced to 15 years in prison, according to court documents.

Gregg then moved to withdraw his plea in its entirety two days later after a lab tested the white powder he had in his possession at the time of arrest and determined it to be powdered milk.

RELATED: Look how often field drug tests send innocent Georgians to jail

When asked why he pleaded guilty, Gregg told a judge he wanted to get out of the Oklahoma County jail.

Oklahoma County District Judge Timothy R. Henderson granted the request, and Gregg’s plea was withdrawn Thursday, according to court documents.

Oklahoma County Special Judge Mark McCormick, who issued the initial sentencing, was presented with the new evidence and the withdrawal of Gregg’s plea Friday and dismissed the case entirely.

The incident occurred on Aug. 12, when Gregg was allegedly riding a bicycle with no rear lights or reflectors while shirtless and wearing a backpack. Police attempted to stop him around 10:30 p.m.

An officer reported in the affidavit that Gregg “did not stop but started to pedal harder as if he was trying to get away," causing the officer to pursue Gregg for about three blocks before he said Gregg dropped his bike and took off on foot.

According to the affidavit, police searched the backpack and found a coffee can containing a large plastic baggie filled with a white powdered substance, which the officer believed to be cocaine. There was also a scale inside the backpack.

Gregg was then arrested and taken to the Oklahoma County Jail. While at the jail, a second officer performed a field test of the powdery substance in the Oklahoma County Jail Drug Testing Facility, which tested positive for cocaine.

RELATED: '$2 Tests: Bad Arrests' wins a 2018 Peabody Award

"The white powder inside the baggy later tested positive for cocaine and was a total package weight of 45.91 grams of cocaine," the officer wrote in the affidavit.

Captain Larry Withrow of the Oklahoma City Police clarified that field testing of potential drugs by officers “is simply one part of the totality of the circumstances that can lead an officer to believe that enough probable cause exists to legally effect an arrest,” adding, “The tests performed by our drug lab are clearly more sophisticated and obviously more time consuming than a simple field test.”

This story was reported from Los Angeles.