WASHINGTON - A sweeping farm bill failed in the House on Friday, May 18, in a major embarrassment to GOP leaders who were unable to placate conservative lawmakers demanding commitments on immigration.

Leadership put the bill on the floor gambling it would pass despite unanimous Democratic opposition. They negotiated with members of the conservative House Freedom Caucus up to the last minutes.

But their gamble failed. The vote was 198-213, with 30 Republicans joining 183 Democrats in defeating bill.

The outcome exposed what is becoming an all-out war within the House GOP over immigration, a divisive fight the Republicans did not want to have heading into midterm elections in November that will decide control of Congress.

The bill's collapse also revealed the intractable divisions within the GOP conference that have bedeviled House Speaker Paul Ryan, R-Wis., and will be certain to dog the top lieutenants in line to replace him, Majority Leader Kevin McCarthy, R-Calif., and Majority Whip Steve Scalise, R-La.

With moderate Republicans maneuvering to force a vote on legislation offering citizenship to some younger immigrants who arrived in the country as children, conservatives revolted. The farm bill became a bargaining chip as they lobbied leadership for a vote on a hard-line immigration bill.

Leaders tried to come up with a compromise, but a series of 11th-hour negotiations, offers and counteroffers failed. Both McCarthy and Scalise will take their share of the blame for the failure, and their fortunes in the race to replace Ryan next year could suffer accordingly.

The farm bill itself became practically a sideshow, despite its importance to agriculture and the significant changes it would institute to food stamp programs.

On immigration, Scalise described a deal that would ensure a vote on a conservative immigration bill by Reps. Bob Goodlatte, R-Va., and Michael McCaul, R-Texas - while also allowing moderate Republicans the opportunity to negotiate on legislation that could win the support of President Donald Trump and resolve the status of immigrants who face losing protections offered by the Deferred Action for Childhood Arrivals program, or DACA.

"We came to an agreement that I think gives everybody what they want," Scalise said ahead of the farm bill vote. "That's a vote on Goodlatte-McCaul as well as an opportunity to try to work with the president on an alternative that can pass on DACA. We want to solve the DACA problem and secure the border and I still think there's a path to get there working with the president."

The solution may eventually emerge, but it didn't do so in time to save the farm bill Friday.

Goodlatte-McCaul bill authorizes construction of a border wall, cracks down on "sanctuary cities" that protect immigrants against federal immigration authorities, and provides for three-year temporary guest work permits that don't offer a chance at citizenship. Leaders and conservatives alike agree that it doesn't command the votes to pass the House, but nonetheless conservatives want to vote on it.

The farm bill itself broke open partisan divisions in the House as Democrats abandoned negotiations with Republicans over the food stamp changes, which would require adults to spend 20 hours per week either working or participating in a state-run training program as a condition to receive benefits. Democrats argue that a million or more people would end up losing benefits as a result because most states don't have the capacity to set up the training programs required.

House Democratic Leader Nancy Pelosi, D-Calif., described the legislation as "cruel" and argued that with the proposed changes to food stamps, "Republicans are taking food out of the mouths of families struggling to make ends meet."

Republicans contend the food stamp changes are a reasonable approach that would help move able-bodied adults from poverty to work. "Our bill goes shoulder-to-shoulder with recipients to help get them the training and education they need to attain a job that can provide for them and their families," said Agriculture Committee Chairman Michael Conaway, R-Texas.

The ranking member on the House Ag Committee, western Minnesota’s Rep. Collin Peterson, D-Minn., had urged defeat of the bill, which every time it comes up seems to boil down to Republicans wanting to cut the SNAP program or require work for most recipients. However, Peterson has pointed out that the bill has always had bipartisan support as rural legislators favor the farm aid, while their urban counterparts focus on the food stamp program to provide food for poor city families.

With the defeat, Peterson said “this is a good opportunity for us to return to the table and fix this bill before we move forward. As I said in my remarks Wednesday, this job is too big for one party. Let’s come together and figure out a bill that works for everyone. We don’t have to let this process be held hostage by the demands of the extremes of our parties. We can and should take the time to get the farm bill right.”

Rep. Kevin Cramer, R-N.D., who is running for the U.S. Senate this year, voted for the bill. He said Friday in an interview with the Williston Herald that despite the loss, a motion to reconsider it later did pass, which means the farm bill is going to live another day in the House. Cramer said that while it was regrettable the bill failed, he is confident that the bill will get the votes it needs from the Freedom Caucus, once the immigration issue has been brought to the floor, debated, and voted upon.

Cramer said he has worked on several provisions in the farm bill such as fixing the Area Risk Coverage program, directing the Secretary of Agriculture to waive some swampbuster requirements and fixing rain insurance rules.

A Democratic hopeful for Cramer's seat this fall, Mac Schneider, said in a statement, "The House version of the 2018 farm bill became the latest casualty of toxic partisanship in Congress. The bill should have made needed improvements in the farm safety net at this time of low commodity prices and preserved conservation programs used by North Dakota producers. Unfortunately, the debate on what could have been a bipartisan bill devolved into an ideological spat over the nutrition title and, more recently, immigration policy.”

The House farm bill would have been a non-starter in the Senate anyway, which is writing its own farm bill. Any legislation that ultimately makes it to President Trump's desk will have to look more like the Senate version, where bipartisan support will be necessary for anything to pass and there is not sufficient support for the food stamp changes.

Trump had tweeted his support for the House bill late Thursday, writing: "Tomorrow, the House will vote on a strong Farm Bill, which includes work requirements. We must support our Nation's great farmers!" So the president, too, shares in Friday's failure.

The current farm bill expires Sept. 30 and the legislation would have reauthorized numerous programs and policies. In addition to the food stamps, flash points included an extension of supports for the sugar program, which a coalition of conservative lawmakers backed by free-market outside groups tried unsuccessfully to get rid of in an amendment defeated Thursday.

The legislation also would have extended the Agriculture Department's subsidy program that compensates farmers when average crop prices fall below certain levels - and expanded by widening who counts as a "farmer," for subsidy purposes.

Conaway pleaded for the legislation before the vote. "Times are not good right now in the heartland. Many of our nation's farmers and ranchers, who have been struggling under the weight of a five-year recession, are just one bad year away from being forced out of business," he said. "And in the face of these serious challenges, the last thing they need is the uncertainty of a prolonged debate over the 2018 farm bill."

Forum News Service contributed to this report