The 48-year-old Romanian, who lives on the streets and in between shelters in Murcia, had climbed in after mistakenly thinking it contained clothing destined for recycling.
Police were called after passersby heard a man calling for help from inside a bin in the Vistabella neighbourhood.
He had managed to find his way in despite the container using a tilting door mechanism to stop people from raiding them, a practice that has reportedly increased during Spain’s prolonged economic crisis.
A local policeman said: “We just don’t know how he managed to climb in there.”
Officers at the scene were unable to free the man and had to wait for council workers to arrive and open the container.
He was freed after half an hour without injury.
Some 31% of Murcia are at risk of poverty, making it one of the poorest regions in the country.
Councils across Spain have begun locking their bins to prevent the surge of bin scavenging.
- IN PICS: New Gibraltar property development to rival London’s Mayfair - 24 May, 2019 @ 09:52
- Agnese Klavina’s family to take case to Supreme Court after ‘shock verdict’ sees Marbella based Brits accused of kidnap ‘walk free’ on lesser charge - 23 May, 2019 @ 13:38
- REVEALED: Majority of Andalucia’s El Corte Ingles stores in the red while Marbella and Malaga the ONLY Costa del Sol outlets to return a profit - 23 May, 2019 @ 11:07
- BUSTED: €600 million empire which trafficked drugs into the UK and laundered money into Spain’s property market - 22 May, 2019 @ 18:38
- British most obsessed with doggy-style while Spain loves ‘cuckolding’, as new study reveals world’s sexual preferences - 22 May, 2019 @ 17:36
- WARNING: Multi-day heatwaves and life threatening temperatures coming to Spain this summer - 22 May, 2019 @ 16:25
- WE’VE GOT THE POWER: Dozens of expats fill up the ballot lists for vital local elections in Spain’s Andalucia - 22 May, 2019 @ 13:12
- HAY FEVER EPIDEMIC: Expert reveals why your allergies seem much worse in Spain this year - 22 May, 2019 @ 12:47
- Liverpool FC brings extreme security measures to Marbella football training ground ahead of Champions League final - 22 May, 2019 @ 10:35
- MISSING: British expat and dementia sufferer, 83, disappears on Spain’s Costa del Sol - 21 May, 2019 @ 11:25