WASHINGTON — Congress on Wednesday overwhelmingly approved a five-year farm bill after removing conservative priorities that had stalled negotiations, including stricter work requirements for people receiving food benefits and a provision allowing more tree-cutting in federal forests as President Trump proposed in the wake of California's wildfires.

The sweeping $867-billion bill, a compromise between the House and Senate after a months-long impasse, addresses agriculture, nutrition, forest and conservation policy. The Senate passed it 87 to 13 Tuesday night. With House passage on Wednesday, 369 to 47, the measure goes to the president for his signature.

Though Trump had called the work requirements for food aid an "imperative," he signaled this week he would sign the bill. He and lawmakers were anxious to reauthorize the twice-a-decade farm law, which had expired Sept. 30, before Congress adjourned at the end of the year.

The final bill does not include House Republicans' controversial work requirements for able-bodied people receiving assistance through the Supplemental Nutrition Assistance Program, known as SNAP, or food stamps. Also dropped were eligibility changes that could have cut benefits to millions. Those were seen as a major barrier to the bill's passage in the Senate.

House Republicans lost their negotiating leverage by losing the party's majority in November's elections. They had to concede to help Senate Republicans get the support of the handful of Democrats needed to reach the Senate's 60-vote threshold.

Senate Republicans said the compromise was the best they could do in a sweeping bill that has to balance the needs of agriculture and food aid across a diverse country.

"This may not be the best possible bill. But it is the best bill possible under these circumstances. And, importantly, it provides our farmers, ranchers and other rural stakeholders much needed certainty and predictability," said the Republican chairman of the Senate Agriculture Committee, Sen. Pat Roberts of Kansas.

More than 42 million Americans received SNAP benefits last year, or about 12.9 percent of the U.S. population, according to the Agriculture Department. The nutrition section of the farm bill, which includes SNAP, accounts for about 80% of the bill's cost.

An earlier House version of the bill had also allowed the government to skip some environmental reviews required by law to accelerate logging in certain areas. Trump and members of his administration latched onto the idea this fall after the Camp fire, which killed 86 people and burned 153,000 acres in Northern California, and the Woolsey fire, which killed three people and destroyed more than 97,000 acres in Southern California.

Some House Republicans said it is unfortunate the forest-thinning provision did not survive.

"I wish we could have done more on forestry. The town of Paradise and the surrounding area has suffered so much and [it is] a prime example of why we need to have better forest management in that state and this whole country," Rep. Doug LaMalfa (R-Richvale) said Wednesday on the House floor.

In a nod to the need to thin forestland, the bill exempts specific thinning projects of between 3,000 and 4,500 acres of forest from public-comment periods.

The final bill also extends a forest management program, supported by conservationists and forestry experts, that has encouraged collaboration between federal and state officials regardless of which level of government is the designated manager of land in question. It also expands that program, known as Good Neighbor Authority, to include counties and tribal lands.

Other provisions would legalize industrial hemp farming, ban the slaughter and import of dogs and cats for human consumption, and extend national bans on dogfighting and cockfighting to include U.S. territories.