Firefighters fought for two hours to prevent an explosive cloud of gas from forming close to a childcare centre after a main ruptured in Toongabbie.
Large quantities of gas gushed into swirling winds when an excavator struck a gas main in Reynolds Street about 1.30pm on Tuesday.
Parramatta Fire and Rescue duty commander Kernin Lambert said firefighters shot high pressure water into the the escaping gas to prevent it from forming a flammable cloud.
High winds pushed the gas in multiple directions forcing evacuations of the residential street for 100 metres.
Children and staff inside a childcare centre in the emergency zone were told to stay inside the building as firefighters provided protection.
Electricity was turned off in the area to prevent electrical ignition and emergency gas crews dug down to locate the main to stop the gas flow.
Forty firefighters from six stations worked to disperse the gas, using monitoring equipment to determine were the winds was pushing it.
Paramedics and police were at the ready during the emergency.
"Firefighters had to wear breathing apparatus and structural firefighting equipment due to the dangers of the gas igniting," Mr Lambert said.
"Firefighters provided protection for a childcare centre located at the edge of the emergency zone, where it was decided the safest form of action was to keep the staff and children within the building."
After the main was shutdown, firefighters continued to operate gas detection equipment to ensure all the gas had dispersed before about 30 residents could return to their homes about 4pm.