After years of study and debate, San Francisco has formally adopted a new law requiring owners to retrofit thousands of buildings, marking the most sweeping seismic regulations in California in years.

Some of the most extensive damage and loss of life from recent earthquakes in California have occurred in apartment houses where dwellings sit on top of a ground-level parking garage or a storefront. The shaking undermines the bottom floor, causing the buildings to collapse and in some cases to pancake.

After years of study and debate, San Francisco on Thursday formally adopted a new law requiring owners to retrofit thousands of these so-called wood-frame soft-story buildings, marking the most sweeping seismic regulations in California in years.

City officials estimate the cost of retrofitting will be $60,000 to $130,000 per building.

Structural engineers have long warned that these ubiquitous structures face a particular risk for collapse during a major earthquake because the garage must carry the weight of the apartments above. Efforts at mandatory retrofitting, however, have largely failed both in local city councils and the state Legislature because property owners have balked at the costs.

When the Loma Prieta earthquake rocked the Bay Area in October 1989, the ground floors of several multistory apartment buildings crumbled in San Francisco's Marina District. The shaking sparked fires that devastated neighborhoods.

In January 1994, the Northridge earthquake caused the Northridge Meadows apartment building to collapse. Sleeping residents were crushed in their beds, and 16 died.

After Northridge, the Los Angeles City Council discussed mandatory retrofitting for soft-story apartments. Hal Bernson, the city councilman who proposed it, said in an interview that property owners fought him "tooth and nail." In the end, the proposal died.

Some landlords in Los Angeles remain firmly opposed to the type of retrofitting now required in San Francisco. Dan Faller, president and chief executive of the Los Angeles-based Apartment Owners Assn. of California, said he does not believe the government should force property owners to make upgrades.

"They're telling businesses how to run their business -- after the city has already given approval to the building the way it is and after the owner has purchased the building the way it is. If they want to make a requirement like that, make the city pay for it," Faller said. "Don't pass a law that forces me to spend $100,000 on my building."

Los Angeles City Councilman Mitch Englander applauded San Francisco for its ordinance and said Los Angeles should do the same. But he was skeptical that there was the political support at Los Angeles City Hall.

"I'd love to see that here in Los Angeles, but I just don't think it's a reality," he said. "From a public safety standpoint, it's really critical -- as we are the epicenter oftentimes of ... earthquakes," he said. "The political will won't be there, because of the cost. You'll have landlords and property owners that will oppose it."

San Francisco officials initially faced similar opposition. City officials and property owners worked for years to reach a retrofitting plan.

Ultimately, property owners determined that the retrofitting was worth the cost if it would prevent widespread destruction in the event of a huge earthquake. The law ended up being approved by the Board of Supervisors on an 11-0 vote.

"They knew that we have to do this. And we have to make sure it's mandatory," San Francisco Mayor Ed Lee told reporters Thursday as he signed the ordinance into law, on the 107th anniversary of the great 1906 earthquake. "In order to be a truly resilient city, we must protect our residents and make sure their homes are safe."

More than 55,000 San Francisco residents live in the 3,000 wood-frame soft-story buildings targeted by the ordinance, and the buildings also house 7,000 businesses with 2,000 employees, according to the city. Backers of the law warn of a "Katrina-like" effect if a big quake knocked many of the buildings over.

"We will get back up on our feet much faster if the population remains housed," Supervisor Scott Wiener said. "And frankly, for several decades, San Francisco has been negligent in not doing this. We've been very slow in moving toward a mandate. We tried a voluntary approach and it did not work."

San Francisco's new ordinance applies to wood-frame buildings built before 1978, which are at least three stories tall and have at least five residential units.

Property owners would be given four to seven years to complete the retrofitting after they receive a notice from the city asking for an inspection. Those with a shorter time-frame are buildings that have a particularly high potential for loss of life, such as buildings that house a nightclub, senior citizens or students, or buildings with 15 or more units.

Property owners must pay for the work out of their own pockets or get a loan. But the ordinance says that they can fully pass on the costs of the seismic retrofitting to their tenants -- even those protected by rent control -- over a period of 20 years.

The retrofitting typically involves adding new walls or steel braces to keep the ground story strong so it doesn't crumble when it is hit with side-to-side motion.

Property owners who refuse to comply with the rules could be taken to court by the city attorney's office.

Only two other cities in California have passed mandatory retrofitting rules for wood-frame soft-story buildings -- Santa Monica, which passed its ordinance shortly after the Northridge earthquake in 1994, and the Bay Area suburb of Fremont. A few other cities, including Berkeley, require only a seismic evaluation, and have voluntary retrofitting rules.

San Francisco officials, including former Mayor Gavin Newsom, worked for years to address concerns from property owners and renters.

One stumbling block was whether banks would loan owners the money to perform the upgrades amid the financial crisis. The city worked with community lenders, which agreed to provide loans. Some property owners said they didn't want to take out the loans in their names, so the city is setting up a system in which the loans can be provided in the name of the property and paid back with increased property taxes.

The San Francisco Tenants Union only recently endorsed the mandatory measure after receiving assurances from the Board of Supervisors that it would streamline the process for low-income tenants to receive hardship exemptions to rent increases due to the seismic retrofitting.

Without the exemptions, most tenants could see increases of $8 to $50 in their monthly rent.

Englander, the Los Angeles councilman, said he was skeptical San Francisco's system would work in Los Angeles, in part because he believed there were many more low-income tenants here that could not afford the rent increases.

"That's one of the unfortunate realities, is that it becomes a fiscal issue. And you lose the public safety discussion," Englander said.