The boy in the southwest German town of Hassloch decided to squeeze himself inside a roughly 20cm by 20cm opening of the claw machine at a supermarket while his parents were shopping, attempting to snag a new toy.
But police said on Wednesday that as the boy snaked himself up inside of the machine, the Plexiglas sheet at the opening shut behind him, trapping him inside.
A passerby saw that the boy was stuck and called for emergency services.
Firefighters arrived at the scene and managed to break a padlock on the machine to open it and release the boy.
His parents showed up just in time to see the firefighters retrieving their son from amid the plush toys.
Police said the boy was not injured.