Chile joined Ecuador and Britain on Wednesday, becoming one of the few countries in the world providing consumers with warning labels about the excessive content of unhealthy ingredients in foods.

The legislation will help families decide what they consume and learn about healthy products, President Michelle Bachelet said.

"This is more than a new law. It is a historic public policy step for the country, with regulations unparalleled in the world," Bachelet, a surgeon, said, adding that the legislation was "comparable only to the efforts Chile made 50 years ago to deal with child malnutrition."

"Half a century later, the fight is against obesity and excessive weight. It's a real problem - half of girls and boys in the first year of school are overweight, and our country is on top of Latin America's obesity indices," the president said.

The new legislation is similar to laws enacted by Britain in 2012 and Ecuador in 2014, requiring "traffic light labels" on foods with warnings in green, yellow or red to indicate caloric content.

By May 2015, according to the Parliamentary Front against Hunger, three out of four people in the region were obese or overweight.

The group named Mexico, Chile, Guatemala and Ecuador as the countries with the worst problems.

The new legislation bans the sale of foods containing ingredients critical for human nutrition that are promoted with toys, such as Ferrero's Kinder Sorpresa (Kinder Surprise) and McDonald's Happy Meals, which have high levels of salt, sugar and saturated fat.

Products of this type cannot be sold with a commercial "hook," Tito Pizarro, who heads the Health Ministry's Public Policy Department, said.

Ferrero and McDonald's have criticized the ban and said they are taking legal action.

The law goes beyond banning the sale of unhealthy products in schools, placing black octagons on packages warning of high saturated fat, sugar, sodium or caloric content, Bachelet said.

"It's a strong and coherent action to deal with a number of factors fostering bad nutrition, excessive weight and obesity," the president said, adding that obesity "is a silent disease that will seriously constrain children's futures."