WASHINGTON (AP) — After more than two years of partisan squabbles over food and farm policy, the House passed and sent to the Senate Wednesday an almost $100 billion-a-year, compromise farm bill containing a small cut in food stamps and preserving most crop subsidies.

White House spokesman Jay Carney said shortly after the vote that President Barack Obama would sign the bill if it reaches his desk.

The measure, which the House approved 251-166, had backing from the Republican leadership team, even though it makes smaller cuts to food stamps than they would have liked. After wavering for several years, the GOP leaders were seeking to put the long-stalled bill behind them and build on the success of a bipartisan budget passed earlier this month. Leaders in both parties also were hoping to bolster rural candidates in this year's midterm elections.

House Speaker John Boehner did not cast a vote on the bill, a commonplace practice for a speaker, but he issued a statement Monday saying it was "worthy of the House's support."

The bill ultimately would cut about $800 million a year from the $80 billion-a-year food stamp program, or around 1 percent. The House had sought a 5 percent cut.

The legislation also would continue to heavily subsidize major crops for the nation's farmers while eliminating some subsidies and shifting them toward more politically defensible insurance programs.

House Agriculture Chairman Frank Lucas, R-Okla., who has been working on the bill since 2011, called the compromise a "miracle" after years of setbacks. An early version of the legislation was defeated on the House floor last June after conservatives said the food stamp cuts were too modest and liberal Democrats said they were too steep.

The House later passed a bill with a higher, $4 billion cut, arguing at the time that the program had spiraled out of control after costs doubled in the last five years. But cuts that high were ultimately not possible after the Senate balked and the White House threatened a veto. The Senate had sought a cut of $400 million annually.

Story continues

Many House conservatives still voted against the bill — 63 Republicans opposed it, one more than June.

One of those conservative opponents was Indiana Rep. Marlin Stutzman. "It spends money we simply don't have," he said.

But 89 Democrats supported it, bolstered by the lower cut in food stamps and money for fruit, vegetable and organic programs.

The final savings in the cost of the food stamp program would be generated by cracking down on some states that seek to boost individual food stamp benefits by giving people small amounts of federal heating assistance that they don't need. That heating assistance, sometimes as low as $1 per person, triggers higher benefits, and some critics see that practice as circumventing the law. The bill that was passed Wednesday would require states to give individual recipients at least $20 in heating assistance before a higher food stamp benefit could be authorized.

Some Democrats said the food stamp cut still is too high.

Rep. Jim McGovern of Massachusetts, one of the states that has boosted benefits through heating assistance, said the cut will be harmful on top of automatic food stamp cuts that already went into place in November.

"I don't know where they are going to make that up," McGovern said.

To pass the bill, Lucas and his Senate counterpart, Democratic Sen. Debbie Stabenow of Michigan, found ways to entice many potential naysayers. They spent more than two years crafting the bill to appeal to members from all regions of the country, including a boost in money for crop insurance popular in the Midwest; higher rice and peanut subsidies for Southern farmers; and renewal of federal land payments for Western states. The food stamp cut was low enough that 89 Democrats voted for the bill.

They also backed away from repealing a catfish program — a move that would have angered Mississippi lawmakers — and dropped language that would have thwarted a California law requiring all eggs sold in the state to come from hens living in larger cages. Striking out that provision was a priority for California lawmakers who did not want to see the state law changed.

For those seeking reform of farm programs, the legislation would eliminate a $4.5 billion-a-year farm subsidy called direct payments, which are paid to farmers whether they farm or not. But the bill nonetheless would continue to heavily subsidize major crops — corn, soybeans, wheat, rice and cotton — while shifting many of those subsidies toward more politically defensible insurance programs. That means farmers would have to incur losses before they could get a payout.

The bill would save around $1.65 billion annually overall, according to the Congressional Budget Office. The amount was less than the $2.3 billion annual savings the agriculture committees originally projected for the bill.

An aide to Lucas said the difference was due to how the CBO calculated budget savings from recent automatic across-the-board spending cuts, known as sequestration.

___

Associated Press writer Darlene Superville contributed to this report.

___

Follow Mary Clare Jalonick on Twitter: http://twitter.com/mcjalonick