– Changes to a federal food program that could have left thousands of needy Americans hungry have been stripped from the 2018 five-year federal farm bill.

The $867 billion, 807-page legislation that emerged from a conference committee of the U.S. Senate and House Monday night kills a controversial House-passed measure that would have required certain recipients of the Supplemental Nutrition Assistance Program (SNAP) to work or spend 20 hours a week looking for a job in order to participate.

The attempt to alter SNAP sparked angry charges of insensitivity and became a flash point in competing bills passed by the House and Senate. In the end, the attempt to save $20 billion over the next decade by tightening eligibility for the program once known as food stamps foundered and disappeared from a conference-committee bill that overwhelmingly passed the Senate Tuesday afternoon.

The bill now heads to the House, where representatives from agricultural states such as Minnesota seem unlikely to endanger funding for farm programs in an ideological fight over a longstanding form of public aid.

The five-year farm bill also shores up dairy price supports, reaffirms sugar beet subsidies, guarantees crop insurance for farmers, funds mental health programs for those facing bad commodity prices, and deals with animal disease, agricultural loans and land conservation.

"We're certainly excited," said Minnesota Farm Bureau President Kevin Paap, a member of the American Farm Bureau board, which voted unanimously Tuesday morning to support the bill.

Paap, a soybean and corn farmer from Blue Earth County, plans to spend the week in the nation's capital encouraging members of the Minnesota delegation and others to vote for passage. Failure to act thus far has put some programs on hold.

Senators Amy Klobuchar and Tina Smith of Minnesota, both Democrats and members of the Senate Agriculture Committee, blessed the conference committee bill enthusiastically and voted for it in their chamber Tuesday afternoon.

"I hope this could be a little bit of a model for what we can accomplish in a bipartisan way going forward," Smith told the Star Tribune in an interview. "Agriculture traditionally has not been such a partisan issue, and the fact that we are able to accomplish so much for so many people is really an important example of what we need to be doing more of in Washington, D.C."

Smith praised the preservation of SNAP, saying that 15 million Americans are experiencing food insecurity. "Realizing that the food stamp program mostly serves seniors, parents and grandparents and millions of children across the country — I think this is really important."

Klobuchar characterized the conference committee farm bill as a "bipartisan achievement" that provided "a strong safety net for farmers" while simultaneously protecting people in need from going hungry. She had urged immediate passage of the bill.

The conference committee bill now goes to the House, where Republican Rep. Tom Emmer of Minnesota hopes for quick passage.

"The changes for dairy farmers and inclusion of the STRESS Act to make mental health resources more available for these folks are especially positive," Emmer said in a statement. "Farmers are looking to Congress to provide certainty in uncertain times and I hope this bipartisan legislation gets across the finish line soon."

The major sticking point between the House and Senate versions of the farm bill was a mandate that adults 18-49 with children over 6 and people 50-60 years old work or spend 20 hours a week job hunting in order to receive supplemental nutrition assistance.

Nutrition programs account for 80 percent of the farm bill. House Republicans who pushed the work restriction called it an incentive to help people better themselves. House Democrats, including Minnesota Rep. Collin Peterson, the ranking minority member of the House Agriculture Committee, said it would deny food to people in need for no good reason. Advocates for the poor said cutting $20 billion from SNAP over the next decade would contribute to hunger in the U.S.

The Senate rebuked the House with an overwhelming bipartisan vote for a farm bill that touted its commitment to SNAP. The conference committee took out the work requirement in exchange for job-training programs.

Republican staff members acknowledged that their caucus had "a lot of passion" for the work requirement. The conference committee talks included a "long, drawn out conversation" on the subject, they said. But they added that House Ag Committee Chairman Mike Conaway was willing to "compromise in conference" because in conference negotiators "find middle ground."

The conference report specifies money for employment and training programs aimed at people over 50, as well as homeless people, those who were once in jail, those who are in substance-abuse treatment programs, and "households with multigenerational poverty." There is language that allows new pilot programs to fight fraud. Additionally, there is an incentive program for retailers who sell healthy food to SNAP recipients.

"When the House put forward that [work] proposal, people saw that as grossly unfair and … when [the farm bill] went to the Senate it was received much more reasonably," said Colleen Moriarty, executive director of Hunger Solutions Minnesota. "I commend them for coming to an agreement."

She said that advocates get nervous every time the farm bill comes up because the federal government is the largest funder of hunger relief in the country. Moriarty noted that 438,000 Minnesotans are on SNAP — largely seniors, children and those with disabilities — and just 5,000 of those are able-bodied, childless adults. She and other advocates feared that people would be forced to look for work when it was inappropriate for them.

Christine Pulver, director of the basic needs program at Keystone Community Services, which operates several food shelves in Minnesota, said Keystone saw its highest demand in history for emergency food in October, the latest month for which information was available.

Among the bigger challenges on the farming side of the bill was finding a way to help America's sagging dairy industry. It came with better protections for farms of all sizes, the Minnesota Farm Bureau's Papp said.

Peterson, recognized as one of Congress' leading authorities on dairy policy, pushed new insurance provisions that he said "offer more flexible coverage for lower cost when dairy farmers need it most."

Edge Dairy Farmer Cooperative, one of the largest Midwestern cooperatives, greeted the new provisions with a "sigh of relief," Edge board President Brody Stapel said in a statement.

"Dairy farmers are hurting and have been hanging on in hopes of something positive," Stapel explained. "And this bill delivers improvements."

Staff writer Adam Belz contributed to this story.