If it survives an expected veto from Mayor Gavin Newsom, San Francisco would become the first major city in the country to pass such a law aimed at curbing childhood obesity. It would go into effect December 2011 if supervisors again approve it after Newsom's veto.
A similar ordinance has been approved in California's Santa Clara County, where it affected about a dozen restaurants.
Supervisors and activists who support the measure said they hoped obesity-curbing efforts like it would eventually spread to other cities, states and the country.
"From San Francisco to New York, the epidemic of childhood obesity in this country is making people sick, making our kids sick, particularly kids from low-income neighborhoods," said Supervisor Eric Mar, who proposed the law.
McDonald's Corp. representatives, who say the law would take the joy out of the Happy Meal, derided the vote outside of lawmakers' chambers at City Hall. The company also said the law threatens business and restricts parents' ability to make choices for their children.
The ordinance includes an amendment indicating that it would not restrict restaurants' free speech or advertising. Food companies have come under fire in recent years for their marketing to children.
Scott Rodrick, an owner and operator of 10 McDonald's restaurants in the city, said after the vote that "there will be sales loss, there may be jobs impacted, and I know the city of San Francisco will lose tax income to people wanting a McDonald's experience without government intervention."
But 13-year-old David Sanchez, of San Francisco, said getting rid of the toy giveaway in the meals shouldn't deter sales.
"I think they don't really need to put the toy in," said David, who added that he eats the occasional Happy Meal and supports the new law. "If the kids want the toys, they can still get the toys."
Rodrick said none of his current menu items would be allowed under the nutritional guidelines in the ordinance. Those standards have been criticized by the company, who said proponents lack the evidence to support the claim that they would help reduce obesity.
Rodrick also pointed out that anyone could circumvent the law easily: "Someone doesn't have to travel very far - a mile outside San Francisco - to get the traditional McDonald's Happy Meals experience."
Concepcion Dawes, a 20-year-old mother of a 2-year-old, said she supports the ordinance - anything to help lessen the food's appeal.
"Fast food is really fattening, and it's really addicting, and sometimes it's hard to tell a child no," she said.