A gas leak closed the Welshmill Lane area of Frome for several hours on Tuesday afternoon.
It is believed that builders cut through a main pipe during construction of a new care home at about 1pm.
A 200m cordon was put in place while West and Wales Utilities were called in to deal with the incident.
The railway line that carries quarry trains through the town was also closed as a precaution. Police said no homes were evacuated.
A Wales and West spokesman said: “On arriving at site we found the leak had occurred as a result of damage caused to our main by a third party contractor.
“We isolated the leak to make the site safe and our engineers worked throughout the afternoon to carry out the necessary repair.
“While no gas supplies were affected, it was necessary to implement a road closure for a short period.”
A spokeswoman for building contractors Highwood said: “When the leak was discovered safety precautions were immediately followed and the relevant authorities informed in order to secure the safety of the site and as a precaution to the surrounding area while repairs to the pipe were carried out.
“No injury to persons or property occurred.
“The site is now fully safe, however, as a matter of procedure further precautionary tests as well as a full investigation into the cause of the leak will be conducted.
“We would like to apologise for any inconvenience caused to our neighbours and we would like to thank them for their understanding and cooperation.”
The area was reopened at about 3.30pm.