Updated

The House voted Thursday evening to cut nearly $40 billion in the next decade from the country's food stamp assistance program.

The 217-210 vote was a major victory for Majority Leader Eric Cantor of Virginia and largely cast along party lines. All House Democrats and 15 Republicans voted against slashing the budget for the program.

[sidebar]

[audio-clip]

Despite its passage in the House, the bill is unlikely to make it through the Democrat-controlled Senate.

The bill's savings would be achieved by allowing states to put broad new work requirements in place for many food stamp recipients and to test applicants for drugs. The bill also would end government waivers that have allowed able-bodied adults who don't have dependents to receive food stamps indefinitely.

Conservatives have said the program has become bloated. More than 47 million Americans are now on food stamps, and the program's cost more than doubled in the last five years as the economy struggled through the Great Recession.

Finding a compromise -- and the votes -- to scale back the feeding program has been difficult.

Conservatives have insisted on larger cuts, Democrats have opposed any cuts, and moderate Republicans from areas with high food stamp usage have been wary of efforts to slim the program.

"I think the cuts are too drastic and too draconian," said Rep. Michael Grimm, R-N.Y. He represents Staten Island, which was hard hit by Hurricane Sandy last year. "Those that really need the program will suffer," he said.

Ahead of Thursday's vote, House GOP leaders reached out to moderates to ensure their support while anti-hunger groups have similarly worked to garner opposition to the cuts.

The food stamp legislation is the House's effort to finish work on a wide-ranging farm bill, which has historically included both farm programs and food stamps. The House Agriculture Committee approved a combined bill earlier this year, but it was defeated on the floor in June after conservatives revolted, saying the cuts to food stamps weren't high enough. That bill included around $2 billion in cuts annually.

After the farm bill defeat, Republican leaders split the legislation in two and passed a bill in July that included only farm programs. They promised the food stamp bill would come later, with deeper cuts.

Republicans have emphasized that the bill targets able-bodied adults who don't have dependents. And they say the broader work requirements in the bill are similar to the 1996 welfare law that led to a decline in people receiving that government assistance.

"Politically it's a great issue," says Rep. Tim Huelskamp, R-Kan., one of the conservatives who has pushed for the larger cuts. "I think most Americans don't think you should be getting something for free, especially for the able-bodied adults."

House Minority Leader Nancy Pelosi, D-Calif., said Tuesday that Democrats are united against the bill.

"Maybe I'm just hoping for divine intervention, but I really do believe that there are enough Republicans that will not identify themselves with such a brutal cut in feeding the American people," Pelosi said at a news conference.

On Wednesday, President Obama threatened to veto any bill that made deeper cuts than the Senate version.

The Associated Press contributed to this report.