A Volusia County sheriff's deputy noticed 43-year-old Amy Moreland purchasing the drug from a dealer while the toddler was sitting behind the driver's seat, according to an incident report.
Moreland was arrested, and she admitted to authorities that she purchased a $20 bag of heroin.
Police also identified a white substance near the driver's floorboard, which tested positive for opiates, along with a cut straw with residue on it and a clear plastic bag containing heroin.
Moreland was arrested for the possession of heroin and drug paraphernalia as well as child neglect. Police contacted the mother of the child to pick them up.
"Grandma is out here buying dope with you. It's not good," the deputy said to the 2-year-old, as seen in a video posted onto Twitter. He also warned Moreland of the dangers of having the child near or in the presence of fentanyl.
"It's definitely, probably, about four to five times as lethal to a child that is 2-years-old. So that bag just opens up and it blows through the air and he breathes it. A) he's gonna be high, but B) it's going to kill him," the deputy said.
The Volusia County Sheriff's Office said this situation may seem "unthinkable to most of us, but addiction makes the unthinkable happen."
Florida had the 17th highest rate of drug overdose deaths in the nation in 2017, a 17 percent increase from the previous year, according to the Centers for Disease Control and Prevention, averaging about 25.1 deaths for every 100,000 people.
That number is expected to increase to 59 deaths per 100,000 people by 2025.