WASHINGTON — The Senate overwhelmingly approved an $867 billion farm bill Tuesday as Congress appeared poised to pass legislation that would help an agriculture industry battered by President Trump’s trade war.

In an 87-to-13 vote, the Senate approved legislation that would allocate billions of dollars in subsidies to American farmers, legalize hemp, bolster farmers markets and reject stricter limits on food stamps pushed by House Republicans.

The legislation will now head to the House, where it is also expected to pass, after lawmakers worked out a House-Senate compromise this month. Trump expressed support for the legislation Tuesday and said he expects to sign it into law.

Congressional negotiators said they faced increasing pressure to complete the bill from farmers and ranchers who have suffered steep declines in commodities prices amid Trump’s ongoing trade war with China.

“We’ve been trying to point out this is no time for a revolutionary farm bill,” said Sen. Pat Roberts, R-Kan., chairman of the Senate Committee on Agriculture, Nutrition and Forestry. “It’s time to get a bill done so our farmers have predictability and certainty during a very difficult time. We just have to do that.”

Agriculture Secretary Sonny Perdue expressed support for the legislation in a statement Monday night.

Still, the bill has faced criticism, including from conservative Republicans. Sen. Charles E. Grassley, R-Iowa, one of two farmers in the Senate and a member of the agriculture committee, said he would vote against the package because of its expansion of federal subsidies to more distant relatives of farmers, such as their cousins, nephews and nieces. Grassley joined eight other Republicans in opposing the measure, which was supported by every Senate Democrat.

Here’s what’s in and what’s out:

 Cuts to food stamps are not in the bill. The most controversial element of the farm bill debate has been over differences between the House and Senate approaches to food stamps, or SNAP, the Supplemental Nutrition Assistance Program.

House Republicans’ farm bill would have forced states to impose work requirements on people ages 49 to 59 who get food stamps. It also would have forced states to impose work requirements on parents with children ages 6 to 12, among other changes. One estimate found those proposals could mean that 1.1 million households would face cuts to benefits, although conservatives and Republicans contested those numbers.

The Senate version of the farm bill made none of those changes. The farm bill requires Democratic support to get the 60 votes it needs to pass the Senate, and these cuts are not in the final package, Sen. Roberts has confirmed.

The bill includes SNAP revisions, although they won’t shrink individual benefits. The final bill does include several new changes to the SNAP program, though none will restrict families’ food stamp benefits, according to congressional aides.

Among them is a new National Accuracy Clearinghouse, which would prevent individuals from receiving food stamp benefits in multiple states. The final farm bill also eliminates an awards program that gave states up to $48 million per year in federal funding for high performances related to program access and payment accuracy.

The projected savings from these changes will be plowed back into food banks and other nutrition assistance programs, aides said.

 The Trump administration has signaled its intention to cut food stamps without approval from Congress, and the farm bill does not bind the White House’s hands, according to congressional aides. The Agriculture Department has already floated weakening the waivers it gives states to temporarily suspend some food stamp work requirements.

 Some expanded farm subsidies. The farm bill mirrors at least some provisions in the farm bill passed by House Republicans, including in expanding some federal agriculture subsidies to nieces, nephews and first cousins of farmers – even if those relatives do not directly work on the farm.

 No additional impact on the deficit. At close to $1 trillion a year, the farm bill’s cost is high. But the bill’s drafters used the baseline set by the Congressional Budget Office under existing spending levels of $867 billion over the next 10 years, meaning it will not increase the federal deficit from prior projections. Congressional aides said late Monday night that they were still awaiting a final score from the CBO.

 Provides permanent funding for farmers markets and local food programs. The final farm bill also provides permanent funding for a number of programs that Congress had agreed to finance on a temporary basis of five years at a time.

The bill also provides permanent funding to help veteran farmers and farmers who are minorities.

 Conservation program preserved. The farm bill proposed by House Republicans had also proposed merging the Conservation Stewardship Program, which pays farmers to strengthen conservation efforts on their farms, into another branch of the Agriculture Department. The program will survive under the final version of the bill, aides said.

Legalizes hemp. The farm bill also legalizes the production of hemp, a form of cannabis with lower THCD levels than marijuana. Analysts told CNBC that hemp could grow into a $20 billion industry by 2022.