The federal government can't block benefits from the nation's largest food aid program from being used to buy candy, soda, and other sugary drinks, a judge ruled.

Monday's ruling scuttles restrictions now in place or planned for the federally funded and state-run Supplemental Nutrition Assistance Program (SNAP) in 23 states. President Donald Trump's administration has not said whether it will appeal to a higher court.

U.S. District Judge Amy Berman Jackson, who sits in Washington and was nominated to the bench by former President Barack Obama, said in her opinion that the ruling was because the federal government did not follow its own definition of "food." She said it wasn't a comment on whether the restrictions are a good idea.

"The federal defendants and the states may have a genuine desire to improve the health of SNAP households by encouraging healthy choices at the store, and they can take lawful steps to meet those goals," she wrote. "But what they cannot do is violate the law and their own regulations along the way."

The Restrictions Are Part of the Make America Healthy Again Campaign