KALAMAZOO, Mich. — A man had to be rescued by emergency crews early Monday morning after the dumpster he was sleeping in was emptied into a garbage truck in Kalamazoo.

Police were called around 4:45 a.m. after the truck driver heard a man screaming in the back.

The Kalamazoo Department of Public Safety’s rescue unit had to use ladders to climb into the body of the truck from the top of the container holding trash. At that point, they were able to get the man out of the confined space and into an ambulance who took him to the hospital.

The man told officers he was sleeping in the dumpster and didn’t get out in time when it was being emptied into the truck.

Police say the man was saved from serious injury or death because the driver hadn’t compressed the trash yet.