A homeless man who was sleeping inside a dumpster in Brockton came incredibly close to being compacted on Tuesday morning.

The Enterprise reports that the man was nearly crushed when the dumpster he was sleeping in was emptied into a front-end loading truck and it began to compact the contents.

An eyewitness, Sal Munafo, told the paper that the homeless man began screaming for his life and the driver of the garbage truck stopped the compactor as Munafo called 911.

Brockton police and fire departments arrived on scene at 137 Plymouth Street just before 8 a.m.

First responders thought the man had suffered an amputation after seeing blood on his jacket and considered calling a medical helicopter to the scene. Although the man was injured, no limbs were severed and he was eventually taken by ambulance to the hospital.

The homeless man was incredibly lucky and somehow "just missed the blade" according to Munafo.

More From WFHN-FM/FUN 107