Police say teachers at the Walnut Grove preschool were adjusting the girl's sneaker Monday when they found the individually wrapped bags of crack inside a larger plastic bag.
The teachers told police the girl said her mother had put "candy" inside her sneaker.
"Where's my shoe? Mommy's going to be mad at me," the girl allegedly told an assistant teacher, according to police.
But the girl's mother told police she knew nothing about the drugs.
More Strange Drug Stories
Demare Gary, 19, of Boston, a friend of the mother's, was arrested after he allegedly told police the crack was his. Officer Eddy Chrispin said Gary told police he put the crack inside the girl's sneaker the night before and forgot about it.
The mother was not arrested, but police said the investigation is continuing.
"Obviously, detectives are continuing to look into the incident to determine whether any further charges should be filed against anyone else," Chrispin said.
The state Department of Children and Families is also investigating. Alison Goodwin, a spokeswoman for the DCF, said the girl was still with her mother Tuesday.
Gary was arraigned in Roxbury Municipal Court on Tuesday on charges of possession with intent to distribute a Class B substance, possession with intent to distribute drugs in a school zone and reckless endangerment of a child.
He was held on $2,000 cash bail and ordered to stay away from the child. His attorney, Lauren Redmond, was still in court and could not immediately comment.