A New York City construction worker who was stuck in the mud for nearly five hours in an underground subway tunnel was rescued by firefighters late on Tuesday night.

According to DNA Info, the subway worker, whose name has not yet been released, was reportedly working on the Second Avenue subway line underneath 94th Street when he sank into chest-high mud. He was finally pulled free by rescue workers at around 1:30 a.m.. Wednesday morning.

A spokesperson for the FDNY told the publication that the rescue effort took longer because the debris trapping the man had to be removed by hand and because workers had to be careful to avoid causing a cave-in.

The spokesman said that more than 150 firefighters from 36 units responded to the call at around approximately 8:38 p.m. on Tuesday. The FDNY was aided in the effort by Con Edison, which deployed large vacuum trucks to help clear the mud surrounding the man.

After finally being pulled to the surface, the worker was wrapped in blankets and taken to New York-Presbyterian/Weill Cornell Medical Center, where authorities say he is being treated for hypothermia.

Three firefighters who aided in the rescue were also taken to the hospital. The fire spokesman said that one was being treated for serious injuries, and the other two for minor injuries.

Officials say that the subway worker is in serious but stable condition and are not yet able to determine how he became stuck in the mud.