WASHINGTON (Reuters) - U.S. lawmakers have reached an agreement on a farm bill that leaves out a proposal to tighten food stamps criteria backed by President Donald Trump, and offers some financial certainty to farmers suffering from the U.S. trade war with China.

Slideshow ( 2 images )

The bill passed the Senate 87-13. Congressional staffers are expecting the House to vote by Thursday and send the bill to Trump for his signature before Friday.

The agreement between Republicans and Democrats on the crucial piece of legislation caps a bitter, months-long debate on the bill, which covers $867 billion worth of food and agriculture programs including crop subsidies and support to growers seeking access to export markets.

The final text shows Republicans in the lame duck Congress had to walk back from some of their demands, the biggest being the proposal, championed by Trump, to impose stricter requirements for recipients of food stamps.

Speaking to reporters at the White House, Trump, who had accused the Democrats of stalling the bill, said the progress on it was bipartisan. “We think the farm bill is in very good shape. A lot of good things are happening with it, and out farmers are well taken care of,” he said.

The debate had delayed the legislation beyond the most recent version’s expiration in September, and was finalized only after Democrats won a majority in the House of Representatives in elections in November.

Food stamps, or the Supplemental Nutrition Assistance Program, is a voucher-type free food program used by more than 40 million Americans, or about 12 percent of the total U.S. population.

The move to tighten eligibility failed to garner enough support in the Senate and was eventually ruled out in the final text. “It was certainly a compromise,” a staffer at the House Agricultural Committee said. “We’ve had significant differences in virtually every title and had robust debate about them.”

SUBSIDIES FOR COUSINS, NEPHEWS AND NIECES

The passage of the bill is essential for farmers, a key Trump constituency, who have been struggling with U.S. trade wars. China, normally one of the top buyers of U.S. farm produce, has largely been absent from the market after the imposition of tariffs.

While farmers have hailed the agreement, others have criticized the bill on its expansion of eligibility for crop subsidies to a farmer’s wider family to include nephews, nieces and first cousins.

The move has prompted powerful Republican Senator Chuck Grassley from farm state Iowa to vote against the bill. “It is a loophole that gets bigger and bigger,” Grassley said.

At the moment, a farmer’s immediate family can be eligible for crop subsidies of up to $125,000 per person, based on “active engagement.” Opponents say the language is vague and could apply to people who do not even live on the farm and only carry out management roles.

A congressional staffer defended the move. “Farming looks a lot different nowadays than it did 50 years ago. Most family farmers are not spending every day on a tractor,” he said, adding that making more family members eligible could help attract younger generations to farming.

The administration has been criticized because a portion, albeit small, of the farm aid designed to offset losses by farmers from the imposition of tariffs ended up with people living in cities who spend little time at a farm.