Firefighters attempt to rescue two workers who became trapped after a trench collapsed in Rye on July 31, 2014. (credit: CBS 2)

RYE, N.Y. (CBSNewYork) — First responders undertook a delicate and difficult rescue operation Thursday, after a trench collapsed in Westchester County.

As CBS 2’s John Slattery reported, the rescuers were in a race against time when the two workers became trapped in tons of dirt after the walls of the trench gave way.

“While in the trench, the trench collapsed and they became stuck in the trench,” said Rye Mayor Joe Sack.

According to Rye fire Lt. Kurt Tietjen, the workers were buried about chest-deep in the 7-foot hole.

The trench collapsed and pinned the workers up against the foundation of a home on Bradford Avenue off Post Road in Rye around 11:30 a.m. Thursday, CBS 2’s Jim Smith reported from Chopper 2.

As WCBS 880’s Paul Murnane reported, the workers were plugging leaks around the home’s foundation when the trench collapsed.

“I’ve been told that there was a leak in the foundation, and they were attempting to repair that leak,” Tietjen said.