In a sign that bipartisan agreement remains possible in Washington as Congress barrels towards a possible government shutdown over border wall funding, the House of Representatives on Wednesday passed a new bipartisan farm bill -- a massive legislative package that reauthorizes agriculture programs and food aid -- by a comfortable 369-47 margin.

But the bill lacks tighter work requirements for food stamp recipients, a Trump-backed provision of the previous House farm bill that became a major sticking point during negotiations. Republicans had pushed to mandate job training for those receiving the federal benefits, but the Senate rejected the idea.

The farm bill measure is the result of months of negotiations by lawmakers. It does not make any significant changes to the food stamp program that serves nearly 40 million low-income Americans. The bill reauthorizes agriculture and conservation programs, funds trade programs, expands support for struggling dairy farmers and legalizes the cultivation of industrial hemp.

The legislation already passed the Senate on Tuesday and is now headed to President Donald Trump, who is expected to sign it. The Senate vote for the bill was 87-13.

Prior to the Senate vote on Tuesday, GOP Senate Majority Leader Mitch McConnell, R-Ky., said tackling the farm bill may ease spending negotiations as a possible government shutdown looms. McConnell brought the bill up for a quick vote, less than one day after the House and Senate reached an agreement on the final text.

CHRISTMAS SHUTDOWN? BORDER WALL SHOWDOWN, BUDGET DEADLOCK RAISE NEW CONCERNS 

"In the meantime, we're going to start processing these various items that are listed, beginning with the farm bill later today," McConnell told Fox News after Trump openly sparred with House Minority Leader Nancy Pelosi and Senate Minority Leader Chuck Schumer in the Oval Office. "And so if that occurs, there won't be any need to put any of those items into a government funding bill, so I can't predict when an agreement will be reached on the government funding bill, so we're just going to keep processing these issues as rapidly as we can."

Other top Republicans and Democrats seemed similarly heartened earlier in the week.

"This is what happens when the Congress works in a bipartisan, bicameral fashion," Senate Agriculture Committee Chairman Pat Roberts, R-Kan., said ahead of the vote. "It's a good bill that accomplishes what we set out to do: provide certainty and predictability for farmers and families in rural communities."

The legislation sets federal agricultural and food policy for five years and provides more than $400 billion in farm subsidies, conservation programs and food aid for the poor. It reauthorizes crop insurance and conservation programs and funds trade programs, bioenergy production and organic farming research. It also reduces the cost for struggling dairy producers to sign up for support programs and legalizes the cultivation of industrial hemp, an initiative championed by McConnell.

"We maintain a strong safety net for farmers and importantly, we maintain a strong safety net for our families," Sen. Debbie Stabenow, D-Mich., the most senior Democrat on the agriculture committee, said. "We said no to harmful changes that would take food away from families, and instead increased program integrity and job training to be able to make sure things should be working as they should and every dollar is used as it should be."

THIS SUMMER: HOUSE PASSED FARM BILL WITH SWEEPING NEW WORK REQUIREMENTS FOR FOOD STAMP RECIPIENTS

The previous House bill would have raised the age of recipients subject to work requirements from 49 to 59 and required parents with children older than 6 years to work or participate in job training. The old House measure also sought to limit circumstances under which families who qualify for other poverty programs can automatically be eligible for the Supplemental Nutrition Assistance Program (SNAP), and earmarked $1 billion to expand work-training programs.

Currently, adults 18-59 are required to work part time to receive food stamps or agree to accept a job if they're offered one. Stricter rules apply to able-bodied adults 18-49, who are subject to a three-month limit of benefits unless they meet a work or job training requirement of 80 hours per month.

Nonpartisan congressional estimates said nearly 4 percent of SNAP recipients -- some 1.2 million people -- would have lost benefits under the subsidy-packed farm bill passed by the House this summer in a narrow 213-211 vote that saw 20 Republicans dissent.

By contrast, the bipartisan Senate bill, which passed 86-11, offered modest adjustments to existing farm programs and made no changes to SNAP.

Throughout the negotiation process, Trump made his support for work requirements clear, tweeting about the issue multiple times. But negotiators ultimately rejected the most controversial House measures related to SNAP, making no significant changes to the program. The outcome is a victory for Democrats, who refused to support them.

The final bill also preserves states' ability to provide waivers, and does not change eligibility criteria. It does increase funding for employment and job training programs from $90 million to roughly $103.9 million per year.

The two chambers also clashed over portions of the bill's forestry and conservation sections. But the most contentious pieces of the House version, such as relaxing restrictions on pesticide use, didn't make it into the final text.

Negotiations were complicated in recent weeks when the White House asked Congress to make changes to the forestry section in response to deadly wildfires in California, giving more authority to the Agriculture and Interior departments to clear forests and other public lands. The final text doesn't significantly increase the agencies' authority.

"We would have liked to see more progress on work requirements for SNAP recipients. ..."

— Agriculture Secretary Sonny Perdue

Agriculture Secretary Sonny Perdue said Monday the bill "maintains a strong safety net for the farm economy, invests in critical agricultural research and will promote agriculture exports through robust trade programs," but voiced disappointment over the failed changes to the work requirement.

"While we would have liked to see more progress on work requirements for SNAP recipients and forest management reforms, the conference agreement does include several helpful provisions, and we will continue to build upon these through our authorities," he added.

The bill also maintains current limits on farm subsidies, but includes a House provision to expand the definition of family to include first cousins, nieces and nephews, making them eligible for payments under the program.

House Agriculture Committee Chairman Michael Conaway, R-Texas, a strong proponent of stricter work requirements, thanked Perdue and the administration for their support.

"America's farmers and ranchers are weathering the fifth year of severe recession, so passing a farm bill this week that strengthens the farm safety net is vitally important," Conaway said.

The Associated Press contributed to this report.