Even the sorting hat couldn’t have seen this coming.

A Georgia toddler emulating Harry Potter was unable to execute a vanishing spell after getting a traffic cone stuck on his head and instead needed to wait for firefighters to work their magic to free him, MyFoxAtlanta.com reports.

Click here for the full story at MyFoxAtlanta.com.

Six rescue members worked for 30 minutes on Friday to free the boy, 3-year-old Charlie Thomas, after the boy donned the cone like a wizard’s hat during a game of pretend.

A Somerset Fire and Rescue Service spokesman said it was a rare rescue for the firefighters: "We've had kids stuck in various things and had saucepans stuck on them but never a traffic cone."