The Piper PA-28-140 had just lifted off from Long Island’s Bayport Aerodrome and was attempting to gain altitude when disaster struck Sunday night.

The lone engine died, and before the pilot could return to the airport, the tiny plane was careening toward a busy neighborhood, according to the Suffolk County Police Department.

Witnesses told CBS New York that the plane hit a utility pole and a tree before skidding along the street and bursting into flames at the intersection of two residential streets.

“We were in our house and we heard a big crash,” one witness, Michael Wikan, told CBS New York. “I looked out the window and saw a big, dark cloud of smoke rising to the air. It was kind of short, it didn’t linger.”

Inside the burning wreckage, 34-year-old pilot Scott Clifford and his 65-year-old passenger Michael Rome were still alive, police said.

Volunteer firefighters — some of whom live in the neighborhood — responded to the scene and pulled the two men from the smoke-filled wreckage, which was draped with a downed power line, police said.

Colleen Fleming, a resident of Bayport, told the New York Times that a crowd of “at least” 50 people helped free the men from the wreckage and used garden hoses to put out the flames.

“Everybody was just in that mode — you know, that total concentration, we-gotta-do-what-we-can-do mode,” Fleming told the paper.

Clifford is in serious condition with two broken legs and a head injury, police said in a statement Monday. Rome “suffered non-life-threatening injuries,” the statement said, adding that “the cause of the crash is under investigation.”

Given the circumstances, the incident could have been far worse, authorities said.

“This is nothing short of a miracle, both that the airplane did not hit any houses or any other individuals,” Suffolk County Police Commissioner Tim Sini told reporters Sunday, according to CBS. “The fact that right now both occupants of the plane are alive is also nothing short of a miracle.”