AUGUSTA — Maine Gov. Janet Mills signed into law a bill that closes a loophole that allowed out-of-state garbage to be dumped in a state-owned landfill.

Sarah Nichols from Natural Resources Council of Maine said the bill, signed by the governor on Monday, makes sure landfills are managed with communities’ best interests in mind.

“It will never be okay for companies operating here to exploit Maine’s environment for profit,” she said.

The law closes closes a loophole that allowed trash from Massachusetts and New Hampshire to be processed in Maine, reclassified as Maine waste and then dumped in the Juniper Ridge landfill, near Old Town.

The Juniper Ridge landfill was bought by the state in 2004 and has a sign that says, “Juniper Ridge Landfill only accepts waste generated in Maine.”

But about a third of the waste dumped there comes from out of state because of the loophole, according to the Natural Resources Council of Maine. Juniper Ridge is operated under contract by Casella Waste Systems.