That suspect, 22-year-old Derrell Gibbs of Dagsboro, is facing a number of drug charges.
The incident began around 2:30 p.m. Sunday on School Lane near Long Neck Elementary School in Millsboro.
Police say a trooper attempted to stop a Chevy Malibu for a traffic violation.
Then, police say, the driver abruptly stopped in front of the school. Gibbs allegedly got out and began to run away with a plastic bag in his hand.
The driver of the car sped away as the trooper chased Gibbs on foot. Police say Gibbs then threw the plastic bag to the ground near the northwest corner of the school before he was taken into custody.
Police recovered the bag and discovered 1,252 bags of heroin inside, with a total weight of more than 31 grams.
Gibbs has been arraigned and is being held on $81,600 secured bond.
The driver of the Malibu has not been identified and remains at large.