WASHINGTON (AP) -- Lawmakers have reached an agreement on the farm bill, a mammoth package that will fund key farm safety net programs for the next five years without making significant changes to the food stamp program that serves nearly 40 million low-income Americans.

The agreement, signed on Monday by House and Senate members of the conference committee, is the result of months of negotiations to reconcile conflicting versions of the bill.

"We started this journey nearly two years ago," said Senate Agriculture Committee Chairman Pat Roberts, R-Kan., in a statement. "As promised, this farm bill provides much needed certainty and predictability for all producers -- of all crops --across all regions across the country."

The measure bears a price tag of $867 billion over 10 years and is expected to be brought to a vote this week, though exact timing is uncertain.

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, funds trade programs, bioenergy production and organic farming research. It also makes reduces the cost for struggling dairy producers to sign up for support programs and legalizes the cultivation of industrial hemp, an initiative championed by Majority Leader Mitch McConnell, R-Ky. On Monday evening McConnell Tweeted a video of himself signing the conference report.

"Making it official with my hemp pen!" he wrote.

One thing the bill doesn't have: tighter work requirements for food stamp recipients, a provision of the House bill that became a major sticking point during negotiations.

Currently able-bodied adults ages 18-49 without children are required to work 20 hours a week to maintain benefits under the Supplemental Nutrition Assistance Program, or SNAP. The 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 House measure also sought to limit circumstances under which families who qualify for other poverty programs can automatically be eligible for SNAP, and earmarked $1 billion to expand work-training programs.

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

"We overcame many differences to deliver a strong, bipartisan farm bill for our farmers, families and rural communities," said the senior Democrat on the Senate Agriculture Committee, Debbie Stabenow, D-Mich.

Negotiators ultimately rejected the most controversial House measures related to SNAP. The outcome is a victory for Democrats, who refused to support them.

Throughout the negotiation process President Donald Trump made his support for work requirements clear, tweeting about the issue multiple times.

But the final draft doesn't make any changes to existing work requirements for SNAP recipients, nor does it eliminate states' ability to provide waivers or 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.

Agriculture Secretary Sonny Perdue said on 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 he 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 said.

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 bill is expected to get bipartisan support.

"The bill invests in research, outreach to beginning and underserved producers, local and organic food production, bioenergy, and access to new markets," said the senior Democrat on the House Agriculture Committee, Rep. Collin Peterson, D-Minn. "It's the product of strong bipartisan work in both the House and the Senate, and it's something I'm proud to encourage folks to vote for."