House Republicans narrowly approved a sweeping overhaul of the nation’s food stamp program Thursday that would slash about $39 billion in funding over the next decade, cut aid to about 4 million Americans in the next few years and shift the burden of providing aid to some of the nation’s poor to state governments.

The GOP-backed plan differs sharply from a bipartisan Senate proposal passed in June, and its passage will further strain relations between the two chambers as they spend the next several weeks toiling over a short-term budget deal and negotiating over raising the federal debt limit.

As those battles begin, Thursday’s vote is a victory for House Majority Leader Eric I. Cantor (R-Va.), who orchestrated a strategy this summer to split apart the farm bill to consider funding for food stamps, or the Supplemental Nutrition Assistance Program, separately from legislation authorizing crop subsidies and an overhaul of many agricultural and conservation programs.