Mexico has become the standard bearer in the global fight against obesity, after parliamentarians passed a law imposing significant new taxes on junk food and sugary drinks.

The vote by congress is a triumph for the anti-obesity crusade of President Enrique Peña Nieto, who will now sign the measures into law. As the legislation was passed, he called for a "change of culture" in his country, including the incorporation of at least an hour of exercise for all Mexicans every day. Mexico has higher rates of adult obesity even than the United States, according to the UN Food and Agricultural Organisation this year – 32.8% against 31.8% of Americans.

"We can't keep our arms crossed in front of a real overweight and obesity epidemic," the president said. "The lives of millions of Mexicans are literally at risk."

Taxes on unhealthy foods and sugary drinks such as colas and lemonades have been introduced by a few other countries in Europe and Scandinavia, but often subtly. Mexico has confronted the food and drink industry head on, resisting tough lobbying and warnings that raising prices would do nothing to help the country's economy.

But the government has taken the long view – that the potential economic harm from reduced junk food and soft drink sales now is insignificant compared with the damage in 10 years time if obesity continues at the current rate. The healthcare burden of diabetes and heart disease in Mexico is already huge and increasing. Some 9.2% of children in Mexico now have diabetes.

The taxes will increase the price of junk foods – those high in saturated fat, sugar and salt – by 8%. It will also put one peso (about 4p) on a litre of sugary drinks such as Coca Cola, which Mexicans consume in vast quantities at a rate of 43 gallons per person per year – the highest in the world. The money raised is intended to go towards health programmes and increased access to drinking water in schools. Among other measures, the government will introduce a nutritional stamp of approval for healthier foods on sale in supermarkets.

Obesity campaigners worldwide have been looking to food and drink taxes as a way to encourage people to change their diet and reduce the amount of fattening food and drink they consume. Norway has had higher duties on sugar, chocolate and sweetened drinks since 1981 and Samoa, which has very high obesity, has had taxes on sugary drinks since 1984. Australia introduced a 10% tax on soft drinks, confectionery, biscuits and bakery products in 2000.

Most of these taxes have not been high profile, however, avoiding a fight with industry. France attempted to introduce a tax on sugary drinks, but under pressure from manufacturers, conceded that it should apply to diet drinks as well as those containing sugar, which avoided characterising sugary drinks as unhealthy. Hungary has the most extensive anti-obesity tax, which applies to foods high in sugar, fat and salt as well as to sugary drinks, but it is at a low level and has also been politically difficult.

The food industry claims such taxes are a burden on the poor and do not work. They cite the Danish example. In 2011, the Danish government imposed a tax on all foods containing more than 2.3% saturated fat, which hit such popular staples as butter and bacon. It was unpopular partly because it was introduced by the treasury as a fundraiser, rather than being presented as a measure to improve population health.

Newspapers ran stories about Danes stockpiling and crossing the border to buy cheaper butter. Eventually the government fell, and the tax was withdrawn after six months.

But, says Professor Mike Rayner, director of the British Heart Foundation Health Promotion Research Group at Oxford University, "the Danish saturated fat tax is a dream from a researcher's point of view. We're beginning to get the preliminary results of the introduction of the tax. Of the data they have already got, it had a 4% effect on saturated fat levels. It is completely wrong to say it didn't work."

What is happening in Mexico is "really interesting", he said. "We need more of these steps around the world to come up with good clear evidence of their effectiveness."

Rayner and colleagues published a paper this week in the British Medical Journal based on modelling rather than real-life experience, which suggested a tax on sugary drinks of 20% in the UK would cut the number of obese adults by 180,000 and those who are overweight by 285,000.