The boy was playing with his little brother at the home in Lichterfelde, Berlin, when he found the ultimate hiding place.
Unfortunately, the door to the unused safe closed on the boy, locking him in.
His whereabouts were eventually uncovered - but his grandfather was the only person who knew the entry code, and he was away.
With no other option, the family called for help from the fire brigade.
It took three hours of testing family birth dates in the hope of uncovering the secret entry code, while oxygen was pumped into the safe through a tiny crack as a precaution.
Just as a specialist team was about to start breaking the safe open, they entered the correct six-digit code.