LONDON — Three primary school age children in one English city reaped more than the usual harvest of sweets and chocolates on Halloween when they emptied their trick-or-treat goody bags and found several bags of cocaine.

On Monday, the man who had mistakenly handed out his cocaine stash to the children instead of candy was given a community service sentence in court, the Press Association reported.

Apprentice panel-beater Donald Junior Green fished in his pockets for a bag of chewy sweets to give to the youngsters at his door on Halloween, but instead pulled out a plastic pack containing eight bags of cocaine he had bought for 200 pounds ($320) earlier that day, Oldham Magistrates’ Court heard.

He dropped the drugs into the goody bags carried by the three children, aged eight, six and five, who were out trick-or-treating escorted by their father, an off-duty policeman.

The 23-year-old defendant then closed the door, went back inside the house and put his hand in his pockets to get out his drugs – but instead pulled out the sweets.

Green immediately realised what had happened and went on foot, then by car, scouring the streets of Oldham in northern England to find the youngsters.

But the officer, Pc Simon Fowell, had taken his children home and, as they emptied their bags to share the spoils, he spotted the drugs, and made a swift call to on-duty colleagues.

Green was given a 12 month community order, ordered to do 130 hours community work and told he must pay court costs totalling 145 pounds.