WASHINGTON — Governors in several states are using a loophole in the farm bill to restore food aid for thousands of low-income families, potentially wiping out billions of dollars in savings Congress agreed to last month.

The action has led to a spat between the mostly Democratic governors and Republicans in Congress, who say the changes amount to an end-around of the bipartisan agreement that took House and Senate negotiators years to piece together.

The loophole concerns a provision, known as “heat and eat,” that allows people to get added food stamp benefits if they also qualify for a program that helps pay heating costs for the poor.

To qualify, people previously needed to get as little as $1 in heating aid. Several states provided that amount so residents could get more food stamp benefits. Congress sought to curb the practice — and save $8.5 billion — by raising the minimum requirement to $20.

Governors in eight states have responded by simply giving people another $19 to qualify for the extra food stamp benefits.

Maine leaders are considering making such a change.

House Speaker John Boehner, R-Ohio, earlier this month threatened legislation to stop what he called “this cheating and this fraud.”

“Governors who choose to undermine the bipartisan reforms in the farm bill are putting those who depend on the home heating program at risk, and taking money out of every American taxpayer’s pocket,” said Michael Steel, a Boehner spokesman.

The governors dismissed those complaints and said what they’re doing is perfectly acceptable under the law.

“Clearly, Congress intended to grant states the authority to provide this vital benefit which is a lifeline to some of our most vulnerable constituents,” Connecticut Democratic Gov. Dannel Malloy wrote in an angry letter to Boehner.

“We’re following the law that [Congress] wrote,” Montana Democratic Gov. Steve Bullock said in an interview. “It took them six years of negotiating for them to pass a five-year farm bill, and to expect us to do anything but follow the law they passed is absurd.”

Bullock said that his action means 2,000 households with a combined income of $10,000 a year or less will get additional food aid. The extra aid would mostly go toward helping seniors and the disabled who “are making choices every day to keep their family fed,” he said.

“The pushback is political games,” Bullock said, “rather than dealing with the folks on the ground.”

The way the farm bill is playing out is the latest example of how federal laws work differently depending on where people live — and what party their leaders belong to.

Of the sixteen states and the District of Columbia that operate the heat and eat program, Montana, Connecticut, Massachusetts, New York, Oregon, Pennsylvania, Rhode Island and Vermont have already moved to expand heating aid to preserve food stamps for low-income residents. Tom Corbett of Pennsylvania is the only Republican of the bunch.

Washington Democratic Gov. Jay Inslee will meet with advisers later this month to determine whether his state can adjust payments, while leaders in California, Michigan, New Jersey and Wisconsin, as well as Maine, also are considering making the change.

Without the change, tens of thousands of households stand to lose about $29 per month for a family of three or $36 per month for a family of four.

In most cases, making the higher heating payments won’t cost states any money. That’s because the money comes in the form of federal block grants and most states end up with extra money from those funds at the end of each year.

Corbett said earlier this month he would increase minimum payments to $20 in order to preserve benefits for about 400,000 low-income residents. That means the state will have to pay out up to $8 million in extra heating aid, but Pennsylvania will be able to cover that with the $190 million it receives every fiscal year in federal block grants.

The windfall states receive from the federal government also greatly outweigh the costs in heating aid. Oregon, for instance, will spend $2 million on additional heating assistance to make about 100,000 residents eligible for more food aid. As a result, those residents will receive $56 million in federal food stamps. New York will spend $6 million to make 300,000 residents eligible for $547 million in additional benefits.

The food stamp program was one of the major sticking points of the $956.4 billion farm bill that passed in February. Republicans had initially sought to trim tens of billions in benefits from a program that has increased sharply in recent years, while Democrats resisted any cuts.

After considerable negotiations, the Senate version of the farm bill sought to save about $4 billion over a decade through the heat and eat program by raising the threshold for qualification from $1 to $10. The House version originally sought to slash $40 billion in cuts. Ultimately, the two sides settled on $8.5 billion in food stamp cuts.

If all of the states that operate the heat and eat program take advantage of the loophole, all $8.5 billion in cuts would disappear.