The department initially issued an alert on social media shortly before 10 a.m. about the natural gas leak in the area of 24th and Hampshire streets.
PG&E spokesperson Tamar Sarkissian said a third-party crew not employed by PG&E struck a 2-inch gas line and that utility crews responded to stop the leak before making repairs.
The Fire Department said at about 12:15 p.m. that the leak was stopped and people were allowed to return to the affected buildings nearby. 24th Street remains closed between Potrero Avenue and York Street while crews repair the gas line.