A cavernous sinkhole opened up on Sacramento Street in San Francisco’s Pacific Heights neighborhood Thursday evening after a large sewer line broke beneath the road, officials said.

City crews were on scene to investigate a depression in the roadway around 5:30 p.m. Thursday when the pavement gave way and a hole — approximately 10 feet deep, 22 feet long and 17 feet wide — formed on the residential street, said Charles Sheehan, a spokesman for the San Francisco Public Utilities Commission.

An 18-inch sewer main broke beneath the pavement, though Sheehan said it was unclear when the pipe ruptured. The free-flowing liquid eroded the soil supporting the road above, leaving a gap. Gravity eventually took hold and the pavement collapsed.

It was unclear what caused the sewer line to break, but San Francisco is in the midst of replacing hundreds of miles of aging sewer lines.

The city has embarked on a plan to dig up and replace the pipelines in the coming decades at an estimated cost of $1.2 billion — all of which will be covered by water ratepayers. To hit that goal, the PUC, which is overseeing the project, will have to more than double the length of water pipes it fixes annually, going from an average of 6 miles per year to 15.

There was no private property damage on Sacramento Street and no customers had water or sewer service cut off, Sheehan said.

Crews worked all day Friday to repair the pipe and were hoping to have the street reopened by Saturday evening.

Kale Williams is a San Francisco Chronicle staff writer. Email: kwilliams@sfchronicle.com Twitter: @sfkale