The plan, which is expected to be formally approved by the governing body of the World Health Organization on Saturday, is a guidebook for countries on designing policies to make people eat better and exercise more.
The ultimate aim is to stem the tide of obesity and other diseases linked to diet or physical activity, such as diabetes, heart disease, cancer, osteoporosis, malnutrition and tooth decay.
Dr. Kaare Norum a Norwegian obesity expert who advised WHO on the development of the plan, said the agreement was a victory for public health and that despite earlier fears, the sugar industry failed to derail the plan.
The plan recommends that people limit their intake of sugar, fat and salt. The sugar limit quickly became a focus of controversy and behind the scenes pressure. Several sugar-producing developing countries sought to eliminate any reference to limiting sugar.
"There was a lot of lobbying from different stakeholders, but in the end public health has been able to be recognized and that's the most important point," said Dr. Catherine LeGales-Camus, assistant director for non-infectious diseases at the World Health Organization.
The plan, which is not legally binding, sets out recommendations such as the reduction of sugar, fat and salt in processed food; the control of food marketing to children and of health claims on packaging; as well as more comprehensive nutrition labeling and health education.
It also provides ideas on ways to make healthier choices easier at school, work and home.
Approaches could include better urban planning so that walking and cycling become more popular and tying toy promotions in with healthy fast-food meals.
The strategy could also be used to build programs that subsidize the provision of fruits and vegetables in school cafeterias or to encourage video games powered by bicycle.
As the Western lifestyle full of cheap and tasty food and technology that allows work and leisure to be less physically demanding stepped up its invasion of the developing world, the looming threat prompted countries two years ago to direct the U.N. health agency to come up with a global strategy to help them figure out what to do.
There are now more fat people in the world than hungry people and infectious diseases though still a significant scourge in some parts are no longer responsible for most of the world's deaths.
Although the general tone of discussions on the plan this week at the annual meeting of top health officials indicated most countries were eager to move forward, it appeared to squeeze through only after late negotiations on the details.
Several developing countries had been fearful that the plan could harm their agricultural industries, particularly their sugar farmers.
Brazil, a major sugar producer, led the effort to finesse the plan's language to allay concerns over trade.
Some developing countries the major agricultural exporters, such as Brazil, Thailand, Indonesia, Malaysia and Argentina are trying to get the World Trade Organization to abolish agricultural subsidies because such support allows rich countries to compete unfairly in international trade.
They were uncomfortable with references to subsidies in the diet plan, which said they can be used to encourage healthier eating.
"We urge the WHO not to place itself in the position whereby its recommendations may be utilized as another tool for establishing trade barriers," Guyana said during the negotiations, adding that unless those concerns were addressed, Caribbean countries would not endorse the health plan.
Brazil said after the agreement was reached that negotiations resulted in language being inserted to ensure that the plan could not be interpreted as "a tool for any kind of trade distorting measures such as subsidies."
"It's not only a health document. It's a political document which contains guidelines. Countries have to feel comfortable," a senior Brazilian delegate said.
Independent health advocates said the changes did not compromise the strength of the diet plan.
By Emma Ross