The girl turned the bag over to her teacher, who found it contained 23 40-milligram Oxycontin pills, The Kingsport (Tenn.) Times-News reported Monday.
The girl's live-in uncle, Dickie Lynn Keirsey, 28, allegedly admitted to putting the bag in the girl's pocket when her jeans were hanging on a clothes rack, Sgt. Chad Gillenwater of the Hawkins County Sheriff's Office told the newspaper.
Keirsey was charged with possession of Schedule II narcotics and reckless endangerment, Gillenwater said.
The girl's common sense prevented what could have been a disaster, said Sheriff Roger Christian.
"What if she had thought they were candy and handed them out to some of her friends? The possibilities that could have arisen from this are unbelievable," Christian told the Times-News.