PORTLAND, Maine (AP) — Maine has decided that eating like a pig could be a good thing, especially for schools looking to cut down on food waste.

A law saying schools can give food scraps away to pig farmers is now on the books in the state.

The practice of feeding human food waste to pigs goes back millennia, but some school districts in Maine have expressed confusion in recent years about the rules around the practice. So the Maine Legislature passed a clarifying bill that took effect Sept. 19.

The new standards will help school districts find a use for spoiled food that might otherwise end up in landfills, say supporters, including Republican sponsor state Sen. Stacey Guerin, of Glenburn.

"In Maine, that was a common practice when I was growing up. Hog farmers would come to the back door and take the waste at the end of the day," Guerin said. "I'm glad school administrators can do that with confidence now, without fear of breaking the law."

The new rules state that any individual or institution, including a school, can donate garbage to a swine producer for use as feed even if they're unaware of the producer's licensure status. Guerin said the rule change made sense because the schools aren't responsible for monitoring the license status of hog farms.

Donations to hog farmers will also help school districts reduce the cost of waste disposal, said Ryan Parker, a Newport resident and farmer who advocated for the bill. Parker has raised pigs of his own and said his hogs were happy to indulge on old milk.

"It's one less thing they have to pay for — get the food waste out of the trash. And if you don't have food waste in your trash, it doesn't smell," Parker said.

Unlike most kinds of livestock, pigs can digest human food waste fairly easily, said Bobby Acord, a consultant with the National Pork Producers Council.

"And pigs have a voracious appetite," he said. "They eat whatever you put in front of them."

The National Conference of State Legislatures said it's unclear how many other states have laws like the one in Maine. The rules about feeding refuse to swine vary by jurisdiction. More than half the states allow garbage feeding, Acord said.

The hog farmers in Maine are required to have a license to feed pigs food waste, and the waste has to be cooked. Those rules, which exist to prevent the spread of diseases such as salmonella poisoning, remain in effect, state officials said.

Not all hog farmers in the state would be able to use the food waste because of the difficulty of collecting and cooking it, but it could still become a way for schools to reduce the amount of unused food they throw out, said Clark Souther, the president of Maine Pork Producers Association.

"Schools have an awful lot of scrap waste from the kitchen and from the tables. So it would add up," Souther said.