MEXICO CITY — Legislators in southern Mexico have approved a ban on selling high-calorie snack food to children, seeking to combat one of the world's highest rates of childhood obesity.

A first of its kind in Mexico, the measure approved Wednesday by the Oaxaca state legislature would fine shopkeepers for selling or giving away high-calorie snack food like sodas, pastries or chips to anyone under 18, unless an accompanying parent or guardian authorized it.

The bill, which has to be signed by the Oaxaca governor to become law, also would ban vending machines from dispensing those same goods and prohibit their sale in or near schools.

Officials in Mexico have blamed junk food and soft drinks for Mexico's high rate of deaths among middle-aged people from COVID-19, saying Mexicans die at younger ages from the pandemic in part because of the country's high rates of diabetes and obesity.

The bill appears to try to skirt the sensitive issue of Oaxaca's traditional snacks — the state produces chocolate — by defining the banned goods as "sugary drinks and packaged foods with high calorie content." Most traditional Oaxaca snacks would apparently not be considered "packaged."

The U.N. Children's Fund considers childhood obesity to be a health emergency in Mexico, saying the country's children have the highest consumption of junk food and many get 40% of their total caloric intake from it. A Mexican government health survey found that 75% of Mexican children were overweight or obese in 2018.

The National Association of Small Store Owners criticized the legislation Thursday, saying it could hurt 58,000 small shops, eateries and street stands and cause job losses in Oaxaca. It said the measure comes as 70,000 small stores across the country have been forced to shut by the coronavirus pandemic.

"History demonstrates that this kind of measure, instead of reducing consumption, increases it. Prohibition promotes informal sales, illegality and evasion, with absolutely no health safeguards," the association's president, Cuauhtémoc Rivera, said in a statement.

Mexico's soft drink bottlers association and other business groups also warned of economic damage in Oaxaca, which is an impoverished state with a large Indigenous population.

Studies have shown that junk food is particularly popular in poor communities, because of its price and ubiquitous distribution, and especially damaging to some Indigenous people with a predisposition to developing diabetes.

State Rep. Magaly López Domínguez, the bill's sponsor, stressed in an interview with the MVS radio station that "parents will have the freedom to choose. It will be they who decide what products they buy for their children to consume."

Earlier this year, Mexico's federal government announced it will require warning labels on high-calorie products, a move that had also was opposed by industry groups. The new rules will require black octagonal stop signs to be printed on the front of packages reading "high in calories," "excessive salt" or "high in saturated fat," among other things.