The Republican U.S. House voted Wednesday to overturn President Barack Obama's key immigration policies, approving legislation that would eliminate new deportation protections for millions and expose hundreds of thousands of younger immigrants to expulsion.

The 236-191 vote came on a broad bill that would provide nearly $40 billion to finance the Homeland Security Department through the rest of the budget year.

Democrats accused Republicans of playing politics with national security at a time of heightened threats, and Obama has threatened to veto the legislation. Prospects in the Senate look tough, too.

But House Republicans, in a determined assault on one of Obama's top domestic priorities, accused him of reckless unconstitutional actions on immigration that must be stopped.

"This executive overreach is an affront to the rule of law and to the Constitution itself," said House Speaker John Boehner of Ohio. "The people made clear that they wanted more accountability from this president, and by our votes here today we will heed their will and we will keep our oath to protect and defend the Constitution."

But Rep. Luis Gutierrez, D-Ill., accused Republicans of "viciousness" for trying to make it easier to deport immigrants brought to the U.S. as children. Rep. David Price, D-N.C., called the GOP effort "a political vendetta," adding, "It's a reprehensible, reckless tactic which will compromise, has already compromised, the full and effective functioning of our Homeland Security Department" at a time of heightened security risks.

The immigration measures were amendments on the Homeland Security bill.

One of them, approved 237-190, would undo executive actions that Obama announced in November to provide temporary deportation relief to some 4 million immigrants in the country illegally. A second amendment would delete Obama's 2012 policy that's granted work permits and stays of deportation to more than 600,000 immigrants who arrived in the U.S. illegally as children. That measure passed more narrowly, 218-209, as more than two dozen more moderate Republicans joined Democrats in opposition.

The changes Obama announced in November especially enraged the GOP because they came not long after Republicans swept the midterm elections, taking control of the Senate and increasing their majority in the House. Republicans pledged then to revisit the issue once Congress was fully under their control.

But even with Republicans in control of the Senate, the bill faces difficulty there, especially because House GOP leaders decided to satisfy demands from conservative members by including a vote to undo the 2012 policy that deals with younger immigrants known as "Dreamers."

Republicans are six votes shy of the 60-vote majority needed to advance most legislation in the Senate, and even some Republicans in that chamber have expressed unease with the House GOP approach, especially given the importance of funding the Homeland Security Department in light of the Paris terrorist attacks.

Some House Republicans acknowledged that the Senate was likely to reject their approach, perhaps forcing them in the end to pass a Homeland Security funding bill stripped of controversial provisions on immigration.

"They're not going to pass this bill," said Rep. Charlie Dent, R-Pa.

Homeland Security money expires at the end of February so House leaders have left themselves several weeks to come up with an ultimate solution.

Immigrant advocates warned Republicans that Wednesday's votes risked alienating Latino voters who will be crucial to the 2016 presidential election.