PG&E spokesman J.D. Guidi said a third party contractor was digging in the roadway and struck a 2-inch plastic gas main just before 10 a.m.
San Francisco firefighters evacuated residents within a one-block radius as a precaution, a fire dispatcher said.
No PG&E customers lost gas service as a result of the main break, Guidi said. He added that crews were expected to complete full repairs by 1 p.m.
San Francisco police were providing traffic control.