California lawmakers approved legislation Wednesday that would allow cities to mandate sterilization of potentially dangerous dog breeds such as pit bulls.

The measure follows incidents including the death in June of a 12-year-old San Francisco boy mauled by his family's pet pit bull.

San Francisco Mayor Gavin Newsom asked for state legislation to allow greater city control over the animals.

"We wanted to institute a mandatory spay-and-neutering program; however, there was a law in Sacramento pushed by advocates at some time in the past that said you cannot pass breed-specific laws," said Newsom spokesman Peter Ragone. "So we had to ask for a change in state legislation."

"People in California are going to be safer because this legislation passed, no doubt about it."

Gov. Arnold Schwarzenegger (R) must sign the bill for it to become law.

Lovers of the breed rallied against the measure, generating most of the 2,100 letters, phone calls and e-mails received by the bill's author, state Sen. Jackie Speier (D-San Francisco), said spokeswoman Tracy Fairchild.

Pit bulls accounted for about a third of the more than 200 fatal dog attacks in the United States from 1979 to 1998, according to a study by the U.S. Centers for Disease Control and Prevention.

Cities including Denver, Miami and Cincinnati ban the dogs.