Three men were trapped when a basement collapsed on Wilson Street Monday, officials said. View Full Caption DNAinfo/Rachelle Blidner

WILLIAMSBURG — Two workers were rescued in Williamsburg Monday morning after a hole collapsed and partially buried them, FDNY officials said.

Three workers, men whose names and ages were not immediately released, had been digging out a yard behind 146 Wilson St., near Bedford Avenue, about 9:16 a.m. when the side of the hole gave way, officials said.

"The dirt collapsed on the guys," said FDNY Deputy Chief Vinny Mandala.

One worker managed to dig himself free, but "the other ones, we dug out with shovels," Mandala said.

"One was trapped up to waist and the other one partially up his legs," Mandala said.

They were freed and taken to Woodhull Hospital, officials said. Their injuries were not considered life-threatening.

Dramatic video posted by Yeshiva World News shows workers furiously digging around their trapped colleagues to try and free them.

A third worker was also treated at the hospital, officials said. His injuries were also not considered life-threatening.

Firefighters evacuated neighboring buildings, bringing about 10 people out onto the street.

"We're checking what they dug out and how that's affected the adjoining buildings," Mandala said.

The Department of Buildings and OSHA were both investigating the incident.