Thirty people were evacuated from their homes late on Saturday night after a gas main sprang a leak and an electricity pylon caught fire.
Residents from about 20 homes in Main Street, Balcurvie, in Fife, were evacuated around 11:50pm.
Fire crews found an electricity pylon on fire and the cable sparking, and a nearby gas main was also leaking. Scotland Gas Networks confirmed the incidents were connected, but they could not yet identify how.
The damage, which included tangled overhead lines, may have been caused by livestock rubbing themselves against the supports on an electricity pole, said energy firm ScottishPower.
The incident came just two days after a suspected gas explosion in Callander, Perthshire, destroyed a house and left an elderly couple needing hospital treatment.
An investigation into the cause of the electricity and gas problems is still under way, but ScottishPower said the contacts at the top of the electricity pole had come loose and crashed against each other.
A spokeswoman added: “This may have been caused by livestock rubbing against the stay [supports], causing the pole to come loose.
“The contact in the overheads fed into the underground network, affecting the earth wire feeding into one of the properties and when it sparked it damaged the plastic gas pipe.
The homes were declared safe by Scotland Gas Networks at 3:30am and supplies reconnected later in the morning. All but one resident was understood to be back home by Sunday afternoon.
A Fife Fire and Rescue spokeswoman said: “Around 30 people had to leave their homes due to a problem with the electricity and gas supply.
“There was a problem with the mains feed from the overhead power lines affecting gas meters in the properties, which could have been dangerous.
“Fire crews were on standby in case any problems emerged.”
A Fife Police spokesman said: “We received a call at 11:50pm from the fire service wanting our assistance in evacuating the houses.
“Fife Fire and Rescue estimated 20 houses were involved, and all were evacuated apart from one where the owner was believed to have been away.
“Fife Fire found a small electrical pylon on fire and said the cable was sparking, and somehow a gas main was leaking as well.
“Transco [now Scotland Gas Networks] arrived and disconnected the gas supply, and at 12:50am they deemed the houses safe to return to but without any gas supply.”
The evacuation came two days after a suspected gas explosion destroyed a house in Callander.
Robin Cunningham, 77, remained in stable condition in hospital last night after he was injured in the blast. His wife, Marianne Cunningham, 74, was released after treatment.