San Francisco has passed a law barring fast-food restaurants from giving away toys with children's meals that do not meet nutritional guidelines.
San Francisco is the first major US city to approve a measure of this kind.
The law, which takes effect in December 2011, says children's meals including toys must have fewer than 600 calories and 640mg of sodium, and derive less than 35% of their calories from fat.
The ordinance was passed in a 8-3 vote by the city's Board of Supervisors.
The board passed the measure with enough votes to survive a proposed veto by Mayor Gavin Newsom.
The law will also put a cap on saturated fats and trans-fats and require fruit or vegetables to accompany each meal.
"What our kids are eating is making them sick, and a lot of it is fast food," said Supervisor Eric Mar, adding that the board's goal was to "work with the restaurants and the fast-food industry to create healthier choices".
The law is being seen by public health officials and activists as one step in a larger fight to make a connection between food marketing and a growing childhood obesity rate in the US.
A similar measure was passed six months ago in California's Santa Clara County, where roughly a dozen restaurants were affected.
Fast-food giant McDonald's, which opposed the San Francisco measure, has said its children's meals meet government nutritional standards, which limit each meal to 600 calories.
"McDonald's remains committed to responsible marketing practices, including advertising and promotional campaigns for our youngest customers," McDonald's senior vice president for marketing, Neil Golden, told the Associated Press news agency.
In 2006, fast-food restaurants spent $161m (£100m) on advertising aimed at under-12s and an estimated $360m on toys distributed with their meals, according to a 2008 Federal Trade Commission report.