A Hare Krishna temple in Leicester was evacuated seconds before an explosion almost destroyed the building, according to fire crews.
A religious celebration was being held at the property in Thoresby Street when one of the occupants went to disconnect a gas cylinder being used for cooking.
Leicestershire Fire Service said the man noticed the valve was leaking and got everyone out with moments to spare.
It was a "miracle" no-one was killed, watch manager Bill Smith said.
He said "Most of the guests were in and around a marquee area just outside the building. In the kitchen they had a large LPG (liquefied petroleum gas) cylinder hooked up to a large gas ring.
"After the meal they disconnected the pipe from the cylinder but the cylinder kept leaking.
"The person who disconnected the cylinder realised the danger of the gas leaking. He ran out and got everybody to run over to the other side of the road.
"Within 30 seconds there was a large explosion. He has no doubt saved the lives of many people with his actions."
A number of people suffered minor injuries and shock, but nobody was seriously hurt in the blast, which shook nearby homes.
A third of the terraced building was destroyed and was left too unstable for emergency services to enter.
There were initial reports that worshippers could have been trapped inside or underneath rubble left by the blast, which happened at 1430 BST.
Firefighters went into the building to conduct a search but it became too unstable to send more in so an urban search and rescue dog was used to scour the wreckage.
The fire service later confirmed everyone had been accounted for.
BBC reporter Jonathan Cecil said he had seen a couple of "walking wounded" outside the temple after the explosion.
East Midlands Ambulance Service said four people, including a firefighter, were treated at the scene for minor injuries.
Nima Gajjar, spokeswoman for Iskcon Leicester, which organised the festivities to mark Lord Krishna's "Appearance Day", said: "We were nearing the end of lunch and that was when it happened. My friend's daughter came up to me and said there was a gas leak.
"The moment she said it I got up, went towards the kitchen area and could smell gas.
"As soon as I smelled it I told everyone to move. As I was there it sounded like a gush of wind.
"As the gush came I remember shouting out 'Run, run', and we got them out. We were picking up each other's kids. I had my son, someone else had my daughter, and as we just got out it exploded.
"We were lucky, so lucky."
Eyewitness Fatima Khatri said: "We were all working and we suddenly heard a big bang and for one split second we thought it was a bomb, so we all ran to the window.
"Suddenly we heard the other bang and we saw all these flames coming out and we just could not believe it because the whole street was shaken up."
Dillon Kidger, who works for a roofing company in the same road as the temple, said the explosion was "that loud that the building shook".
Demolition teams were being brought in to make the building safe.