Off-duty volunteer Bayport firefighters Joseph Walsh and Rich Carey were celebrating their daughters’ confirmations during a gathering at Walsh’s home Sunday night when they heard a loud boom — then the power went out.

Their kids came in from playing soccer on the lawn with news: A plane had crashed right on their street.

Walsh’s 12-year-old son Joey called 911 while he bolted — in socks but no shoes — to where the single-engine Piper Cherokee with two men onboard had crashed after takeoff from the Bayport Aerodrome about 7:04 p.m.

Flames some 25 feet high shot from the aircraft, which had been bound for upstate Orange County. Walsh, a retired FDNY firefighter, grabbed a garden hose and started extinguishing the blaze.

Trapped in the cockpit of the upside down plane was pilot Scott Clifford, 34, of upstate Wallkill and passenger Michael Rome, 66, of upstate Greenwood Lake.

“If we didn’t put the fire out, the guys were dead,” said Walsh, who with his colleagues recounted their lifesaving efforts Monday afternoon at the firehouse.

Carey and another Bayport firefighter, Ed Somerville, who arrived as Walsh was still battling the blaze, pried open the cockpit door. Somerville spoke to Clifford, who asked if Rome was OK and whether the plane had injured anyone on the ground.

advertisement | advertise on newsday

“We’re gonna get you out,” Somerville told him.

Rome was underneath Clifford and barely visible, Somerville said.

“I looked down and saw an arm. . . . I felt a pulse,” said Somerville when he checked on Rome. “I told him, ‘He’s still breathing.’ ”

But both victims’ legs were wedged in the engine compartment, said Bayport firefighter Jerry Dietz, who had to get in the cockpit to pull the men out. Both victims were airlifted to Stony Brook University Hospital, where Clifford was listed in serious condition Monday and Rome was upgraded from fair to good, said hospital spokeswoman Melissa Weir.

Relatives of Clifford and Rome declined interview requests Monday, but in a statement released by the hospital on their behalf, thanked the firefighters for their “heroic efforts.”

“We would like to extend our deepest gratitude to the good Samaritans in the Bayport Community, as well as the First Responders for their heroic efforts in helping rescue Scott and Michael,” the statement said.

Suffolk police said the cause of the crash at Third Avenue and Second Street appeared to be engine failure.

Both the Federal Aviation Administration and the National Transportation Safety Board are investigating.

James Vosswinkel, Stony Brook’s trauma chief, said Monday that the prognosis for both men is good and credited the “quick actions” of the firefighters for saving their lives.

Clifford broke both femurs and several ribs, and Rome had a concussion and a bruised lung. Neither could have escaped the plane by themselves, Vosswinkel said, adding they likely would have succumbed to smoke inhalation or burns if they weren’t extricated.

advertisement | advertise on newsday

“Now you’re talking about smoke inhalation and right there your mortality jumps through the roof,” he said. “They didn’t run, these people came toward them. . . . The residents of Suffolk County truly showed what they’re made of. ”