Police had to be called when the shocked locals in the town of Murcia, in south-eastern Spain, heard a voice coming from a tiny rubbish bin.
According to Daily Mail, when people gathered, it turned out that there was a man inside, a Romanian man, who had climbed in apparently thinking that it contained old clothes he could take.
He had apparently not been put off by the smell of rotting organic waste and once inside discovered he was unable to get back out again.
Police believe he was probably with an accomplice who would have kept watch outside, however they believe the accomplice ran off when his friend got stuck.
Hearing the sounds of the man calling for help, passers-by initially suspected it was a candid camera stunt, and ignored it, but eventually somebody called the police, who turned up and confirmed that there was indeed a man trapped in the bin.
When he explained that he was stuck, they tried to free him, but failed and in the end had to call in council staff to open the bin manually.
This worked and the man was finally freed, without the need to call the local fire brigade.
The incident took place in the neighbourhood of Vistabella and local officials said that the man is 48 years old and originally from Romania, but did not name him.