Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

SAN FRANCISCO— A gas explosion in a San Francisco neighborhood shot flames into the air Wednesday and burned five buildings, sending panicked residents and workers fleeing into the streets.

Utility crews put out the fire about three hours after private construction workers cut a natural gas line, igniting the towering flames, San Francisco Fire Chief Joanne Hayes-White said. Authorities initially said five workers were missing, but the entire construction crew was found safe, and no other injuries were reported.

Officials evacuated several nearby buildings, including a medical clinic and apartment buildings, Hayes-White said. Vehicles on a busy street got rerouted as authorities cordoned off the bustling retail and residential neighborhood.

Pacific Gas & Electric spokesman Paul Doherty, from second-left, and San Francisco Fire Department Chief Joanne Hayes-White, from second-right, speak in a press conference as firefighters battle a fire sparked by a ruptured gas line in San Francisco on Feb. 6, 2019. Stephen Lam / Reuters

The fire damaged a building housing Hong Kong Lounge II, a popular dim sum restaurant frequented by students at the University of San Francisco and tourists. The restaurant made many "best of" lists.

Caroline Gasparini, 24, who lives catty-corner from the fire, said she and her housemate were in their living room when the windows started rattling. She looked up to see flames reflected in the glass.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"We went into crisis mode," Gasparini said. "We grabbed our shoes, grabbed our laptops and grabbed our passports and just left."

Gasparini said they saw employees of the burning restaurant run out the backdoor and people fleeing down the block.

Nick Jalali, 28, was cooking at home when the electricity cut out.

"We didn't hear anything," he said. "We just felt the shaking, and the next thing we knew, people were banging on the door to tell people it's time to start evacuating."

Firefighters worked to keep the fire from spreading while Pacific Gas & Electric crews tried to shut off the natural gas line.

"It's complicated," Hayes-White said of stopping the flow of gas through the damaged pipe. Though she later acknowledged that "as a fire chief and a resident, yes, I would have liked to see it mitigated."

The fire began around 1:20 p.m., apparently by crews working on fiber-optic wires, Hayes-White said.

San Francisco firefighters battle a fire on Geary Boulevard in San Francisco on Feb. 6, 2019. Jeff Chiu / AP

Joseph Feusi lives four blocks away and said he was awoken by what sounded like a jet engine. Feusi, who works nights and sleeps in the afternoon, said he could see the towering flames from his home.

"I think the eight guys are really lucky they didn't get blown to bits," he said.

PG&E spokesman Paul Doherty stressed that the workers who cut the gas line are not affiliated with utility, which is under heightened scrutiny over its natural gas pipelines. A PG&E pipeline exploded under a neighborhood south of San Francisco in 2010, killing eight people and wiping out a neighborhood in suburban San Bruno.

A U.S. judge fined the nation's largest utility $3 million for a conviction on six felony charges of failing to properly maintain the pipeline. California regulators also fined PG&E $1.6 billion, and the utility remains under a federal judge's watch in that case.

Associated Press writers Paul Elias and Olga R. Rodriguez in San Francisco contributed to this report.