WASHINGTON 
The Senate on Thursday completed a five-year, half-trillion-dollar farm bill that cuts farm subsidies and land conservation spending by about $2 billion a year but largely protects sugar growers and some 46 million food stamp beneficiaries.

The 64-35 vote for passage defied political odds. Many inside and outside of Congress had predicted that legislation so expensive and so complicated would have little chance of advancing in an election year.

Senate Republican leader Mitch McConnell called it "one of the finest moments in the Senate in recent times in terms of how you pass a bill."

The bipartisanship seen in the Senate may be less evident in the House, where conservatives are certain to resist the bill's costs, particularly for food stamps. Food stamp spending has doubled in the past five years, and beneficiaries have grown from by about 20 million to 46 million. The program's budget is now about $80 billion a year, comprising 80 percent of the spending in the farm bill.

Farm bills traditionally have been bipartisan efforts, and leaders of the Senate Agriculture, Nutrition and Forestry Committee leaders made a point of showing how their bill would bring down the deficit.

While overall spending on programs covered by the bill has climbed because more people are receiving food stamps, the committee head, Sen. Debbie Stabenow, D-Mich., and the top Republican, Sen. Pat Roberts of Kansas, said the bill would save $23 billion over the next 10 years compared with spending under the current farm bill.

That comes from replacing four farm commodity subsidy programs with one, consolidating 23 conservation programs into 13, and ending several sources of abuse in food stamps. That program is called the Supplemental Nutrition Assistance Program, or SNAP.

The biggest change comes from eliminating direct payments to farmers whether they plant crops or not. The program, which costs about $5 billion a year, has lost much of its support at a time of $1 trillion federal deficits and when farmers in general are prospering.

That subsidy, and a separate one where the government sets target prices and pays farmers when prices go below that level, will be replaced. There will be greater reliance on crop insurance and a new program that covers smaller losses on planted crops before crop insurance kicks in.

The bill also prevents farm "managers," often wealthy people who may not live or work on a farm, from receiving subsidy payments and gives greater help to fruit and vegetable producers and healthy food programs.

The Senate rejected several Republican amendments that would have reduced food stamp spending by such means as tightening up eligibility requirements.

The bill saves about $4 billion over 10 years, a small amount compared with the projected $770 billion in spending for food stamps over 10 years. It stops lottery winners and more affluent college students from receiving benefits and cracks down on benefit trafficking.

Agriculture Secretary Tom Vilsack praised the Senate bill for making progress toward "providing a reformed safety net for producers in times of needs," supporting agriculture research, conserving natural resources, strengthening local food systems and promoting jobs. He expressed hope the House "will produce a bill with those same goals in mind."