A construction crew digging in the 1900 block of Divisadero Street at about 10 a.m. hit a 1-inch plastic gas line and caused the leak, PG&E spokesman Jason King said.
The fire department initially reported that the leak was caused by a truck hitting a gas main but has since confirmed it was caused by excavation work.
There was a strong odor of gas in the area and some people were evacuated while traffic was closed at Divisidero and Pine streets, according to the fire department.
King said that PG&E crews shut off the flow of gas shut off at 10:39 a.m. and expect to have repairs fully completed by 1 p.m.
He stressed the importance of anyone digging to call 811 before beginning to avoid hitting underground gas lines.