U.S. District Judge Amy Berman Jackson on Monday vacated Trump administration waivers that had allowed two dozen states to prohibit SNAP recipients from buying soft drinks, candy, energy drinks and similar products. In a 68-page ruling, Jackson wrote that the Agriculture Department’s approval of the state waivers amounted to rewriting Congress’s statutory definition of “food.”

“The secretary purports to waive not just a mere administrative or technical obstacle, but the very definition of ‘food’ as it was laid down by Congress,” Jackson wrote, an appointee of President Barack Obama. She concluded that “neither the USDA nor the states can force this square peg into a round hole to avoid the plain language of the statute and the requirement of 2026(k),” a provision that requires SNAP projects to remain consistent with the program’s food-assistance purpose.

The waivers, which varied by state, targeted high-calorie, sugary foods and drinks. Twenty-two states had received approval from the Trump administration to exempt such items from the federal definition of food, effectively barring SNAP recipients from using their benefits to purchase them. The program, which serves about 42.1 million low-income individuals, generally allows recipients to buy most foods except alcohol, tobacco and hot prepared meals.

In March, five SNAP recipients — from Colorado, Iowa, West Virginia, Tennessee and Nebraska — sued the administration, arguing that the restrictions were vague, complicated and counterintuitive. They said the rules caused significant confusion for both recipients and retailers, and that some people with chronic health conditions such as diabetes relied on sugary beverages to manage their conditions.

Jackson found that the USDA’s waiver approvals violated the Administrative Procedure Act on two grounds: the department acted in excess of its statutory authority, and it failed to follow notice-and-comment procedures required by law.

The National Center for Law and Economic Justice, which filed the lawsuit on behalf of the recipients, welcomed the ruling. “This decision makes clear that the USDA cannot bypass the legal guardrails that establish how SNAP must operate across the country,” senior attorney Katie Deabler said in a statement. “It affirms that families deserve a program that works without confusion.”