Two workers miraculously survived being trapped in a trench after a mudslide in Westchester, officials said.

The day laborers were trying to repair a leak in the foundation of a Bradford Avenue home around 11:15 a.m., Thursday, when a 7-foot hole they had dug collapsed and the fill trapped them, according to Rye Mayor Joe Sack.

The victims were stuck, chest-deep, and unable to move, witnesses said.

A man, who was walking his dog, saw a cloud of smoke erupt from the ground and heard screams of: “We’re trapped! Get us out of here!” The dog owner and the homeowners called 911.

“There was a leak in the foundation and they were attempting to seal the source of the leak,” said Rye Fire Inspector Lt. Kurt Tietjen, “We were dealing with very unstable land so we started laying down some plywood so that the hole wouldn’t collapse on them anymore.”

Rescuers from New Rochelle and White Plains rushed to assist. Public Works sewer vacuums were used to clear away the dirt, Sack said.

Photo: Robert Kalfus Once that was done, emergency crews rigged a pulley system from a second-story window and hoisted the victims out.

“Once we pulled the men out, we put them on oxygen very quickly,” Tietjen said. “One man was clearly in pain, but they both wanted out of that hole as quickly as possible.”

Neither of the workers were seriously hurt, authorities said.

“Luckily, we have some of the best first responders in the world here in Rye,” Sack crowed. “I think the key to the success in extricating these two men from the trench was the help of police and fire but also Public Works who came with a huge vaccuum machine. It is mostly used for work in sewers, but also for special situations like these.”