A man plummeted off the roof of a four-story Williamsburg building on Tuesday night, only to become tangled in cable wiring on the way down, and find himself hanging precariously upside-down by one of his ankles, three stories above the ground.

Firefighters responded to 378 Hooper Street near the corner of South 2nd Street at 7:11 p.m. on Tuesday. "We could see that he was hanging by little more than a cable wire," firefighter Joe Andres told the News.

"He could have dropped at any point," added Captain Daniel Keane, who described the operation as "rare," adding, "We didn't know when the cable wire was going to snap."

According to an FDNY spokesman, the firefighters proceeded to secure the man with webbing, a type of Kevlar rope that's used in rock climbing, so that "if he fell from the wiring he wouldn't fall too far." After failed attempts to pull him in through a window, Andres was lowered from the roof in a harness. "As soon as I got even with him I basically bear hugged the victim," he said.

Andres then managed to guide the man towards a window on the third floor, where multiple firefighters pulled him to safety. In the spokesman's estimation, the whole rescue took between 20 and 30 minutes.

It has not been determined if the victim, who has not been identified, fell or jumped from the roof. He was transported to Woodhull Medical Center with non-life-threatening injuries.