The House failed to pass a Republican-written farm bill Friday, with a group of GOP lawmakers sinking it as they sought a vote on immigration legislation.

The chamber killed the measure in a 198 to 213 vote. Thirty House Republicans broke with party leaders to vote against the bill, while all Democrats opposed it.

Cheers broke out from Democrats as the legislation failed. House Speaker Paul Ryan moved to reconsider the bill, but it is unclear when it would come to the House floor again.

President Donald Trump, who supported the farm bill, is "disappointed" by the result and "hopes the House can resolve any remaining issues," said deputy press secretary Lindsay Walters in a statement. The Trump administration "underscores the need to bring certainty to our farmers and ranchers and to the many Americans receiving food assistance," she said.

The hardline conservative House Freedom Caucus sought assurances that the House would vote on a tough immigration plan in exchange for their votes, but did not get them. House GOP leaders were seen talking with conservatives ahead of the final farm bill vote, but their efforts could not flip enough Republican lawmakers to pass the measure.

The immigration standoff with conservatives comes as House Republican leaders try to head off a push by centrist GOP lawmakers to force a vote on a plan to shield young undocumented immigrants from deportation. Those GOP lawmakers sit only a handful of signatures on a so-called discharge petition short of securing a series of immigration votes.

The $867 billion legislation to revive farm subsidies that the House took up Friday also included tougher work and job training requirements for people who receive food stamps, or the Supplemental Nutrition Assistance Program. Stricter work requirements is popular within the Republican base.

Democrats opposed the measure, as they warned the requirements could push as many as 2 million people off of food stamps.

The Senate had not yet passed a farm bill. If the House eventually passes the legislation, the Senate version is expected to be different.