By Alexandria Sage and Noel Randewich

SAN FRANCISCO (Reuters) - A massive power outage threw San Francisco into chaos for most of the work day on Friday, knocking out traffic signals, paralyzing businesses and halting the city's famed cable cars.

The power outage, which was triggered by a fire in a PG&E Corp. utility substation, disrupted San Francisco's normally bustling financial district, home to banks and technology companies.

The blackout started just after 9 a.m. (noon ET/1600 GMT) and at one point affected nearly 90,000 customers, according to PG&E. The cause of the fire was a circuit breaker failure at the substation, PG&E spokesman Paul Doherty said.

Office workers unable to access elevators or use their keycards spilled out onto the sidewalks, some wandering the streets in search of an open cafe or sunny spot to enjoy a rare warm San Francisco day.

Others simply went home, with long lines forming for ferries. For many, there was little to do but wait.

"When I got here we had to shut down all the servers, all the work stations were off-line," said Bard Wood, an information technology worker in the financial district. "I'm sure we've lost millions of dollars already. There's no business down here right now."

Some cable car operators snoozed after their cars stalled on the street rails.

Traffic was snarled and emergency workers responded to 20 elevator rescues, according to the city's fire department, but there were no reported deaths or major injuries. But many businesses, from coffee shops to major banks, took a hit.

Wells Fargo & Co closed 13 bank branches and four office buildings, while the New York Stock Exchange said its ARCA options trading floor in San Francisco was briefly unavailable. Employees in Goldman Sachs' financial district office were sent home.

King Lip, chief investment officer at Baker Avenue Asset Management, said his firm was in the middle of a trade when "all our systems went down." He said employees in another state had to complete the transaction.

Two office buildings and a local branch of First Republic Bank were shut down, a sign on the branch's doorway apologizing for the unexpected closure.

Fourteen neighborhoods were affected, including the main shopping district near Union Square, where stores turned signs to "closed" and major retailers such as Macy's and Louis Vuitton shut their doors.

In a city proud of its technological prowess, the outage forced residents back to the dark ages. At the salad bar MIXT, cashiers took credit card payments using old-fashioned paper imprints.

"Old school," commented patron Ben Fackler. "I haven't seen that in forever."

DARKENED BY ONE SUBSTATION

For more than two hours, trains barreled through the Montgomery Street station - one of the busiest stops that services the downtown and financial district - as the outage prevented them from stopping until backup generators came on line, Bay Area Rapid Transit spokesman Jim Allison said.

Power was finally restored to all customers by 6 pm local time, PG&E said.

"Workers have entered the substation. They're assessing the damage and starting to make repairs,” Doherty said.

San Francisco International Airport remained operational, and a U.S. Department of Homeland Security spokesperson said there was no evidence of terrorism. The spokesperson requested anonymity, citing department policy.

"This had nothing to do with cyber," said Joe Weiss, an expert on control system cyber security who has testified to Congress about structural weaknesses in grid components.

"The real question is how could one substation take out, effectively, San Francisco?"

An FBI spokesman said the agency monitored the incident but is not investigating.

Twenty-one San Francisco schools lost power, but remained open nonetheless, according to a Department of Emergency spokesman. At least three hospitals had to rely on backup generators, canceling elective surgeries and redirecting emergency patients to other facilities.

Joanna Gadd, 55, was in the admitting room of the city’s Saint Francis Memorial Hospital waiting for her daughter to undergo surgery when the lights went out.

The diagnostic surgery was canceled. She had forfeited a trip to the United Kingdom, including airfare, to accommodate the operation.

"It is frustrating,” Gadd said. "It's quite nerve-racking going into surgery. She had been fasting, and fasting for someone with diabetes is definitely no picnic."

(Additional reporting by Jeffrey Dastin, David Ingram, Joe Menn, Robin Respaut, Peter Henderson and Liana Baker in San Francisco, Rodrigo Campos in New York, Tom James in Seattle and Nichola Groom in Los Angeles; Writing by Dan Whitcomb and Heather Somerville; Editing by Mary Milliken)