WASHINGTON (AP) — High-calorie sports drinks and candy bars will be removed from vending machines and cafeteria lines at all U.S. schools as soon as next year, replaced with diet drinks, granola bars and other healthier items.

The Agriculture Department said Thursday that for the first time it will make sure that all foods sold in the nation’s 100,000 schools are healthier by expanding fat, calorie, sugar and sodium limits to almost everything sold during the school day.

The rules, required under a child nutrition law passed by Congress in 2010, are part of the government’s effort to combat childhood obesity. The rules have the potential to transform what many children eat at school.

The regulations apply to snacks sold around the school and foods on the “a la carte” line in cafeterias, which never have been regulated before. The new rules, proposed in February and made final this week, also would allow states to regulate student bake sales.

While some schools already have made improvements in their lunch menus and vending machine choices, others still are selling high-fat, high-calorie foods.

Standards put into place at the beginning of the 2012 school year already regulate the nutritional content of free and low-cost school breakfasts and lunches that are subsidized by the federal government. However most lunchrooms also have the “a la carte” lines that sell other foods — often greasy foods like mozzarella sticks and nachos. Under the rules, those lines could offer healthier pizzas, low-fat hamburgers, fruit cups or yogurt, among other foods that meet the standards.

One of the biggest changes under the rules will be a near-ban on high-calorie sports drinks, which many beverage companies added to school vending machines to replace high-calorie sodas that they pulled in response to criticism from the public health community.

The rule would only allow sales in high schools of sodas and sports drinks that contain 60 calories or less in a 12-ounce (0.35 liters) serving, banning the highest-calorie versions of those beverages.

Many companies already have developed low-calorie sports drinks — Gatorade’s G2, for example — and many diet teas and diet sodas are also available for sale.

First lady Michelle Obama, an advocate for healthy eating and efforts to reduce childhood obesity, pointed out that many working parents don’t have control over what their kids eat when they’re not at home.

The Government Accountability Office said it visited eight districts around the country and found that in most districts students were having trouble adjusting to some of the new foods, leading to increased food waste and decreased participation in the school lunch program.

However, the agency said in a report that most students spoke positively about eating healthier foods and predicted they will get used to the changes over time.

The food industry has been onboard with many of the changes, and several companies worked with Congress on the child nutrition law three years ago.