San Francisco Public Utilities Commission spokesman Tony Winnicker said workers accidentally ruptured a 12-inch main near Mason and Filbert streets shortly after 1 p.m.
"It was a contractor who was doing a seismic improvement replacement project for us on an old pipeline," he said.
Since the crew had the replacement part handy, they were able to restore water service in about an hour, Winnicker said.
The work is part of a $4.6 billion water system improvement program to seismically upgrade pipelines in San Francisco and the region, Winnicker said.
The rupture caused some street flooding, which crews were still cleaning up at about 2 p.m.
ABC7 contributed to this report