Police were called after passers-by reported hearing a man calling for help from within a rubbish bin in the Vistabella neighbourhood of Murcia, southern Spain.
The 48-year-old man had to be rescued from the container after he climbed into through the tiny gap to retrieve what he thought was a bag of old clothes.
But he became trapped inside due to a tilting door mechanism which is meant to prevent people from raiding the bins.
The man, who according to local reports is of Romanian nationality, had mistakenly thought the bin contained old clothes destined for recycling.
“We just don’t know how he managed to climb in there,” said Jose Elias a sergeant with the Murcia Local Police.
He said police officers at the scene were unable to free the man and had to wait for council workers to come and open the container.
He was finally freed after spending around half an hour trapped in the bin and was said to be unhurt.