WASHINGTON -- House Republicans voted Thursday to take the highly unusual step of intervening in a Supreme Court case over deportation relief programs they consider to be amnesty for undocumented immigrants, something many of them ardently oppose.

But it's not about immigration, they swear.

"I recognize that this is a very extraordinary step. I feel it is very necessary, though. In fact, I believe this is vital," Speaker Paul Ryan (R-Wis.) said on the House floor ahead of the vote. "This is not a question of whether or not we are for or against any certain policy. Members who are making immigration policy arguments are missing the entire point here. ... It is about the integrity of our Constitution."

The resolution passed in a 234 to 186 vote. Five Republicans voted with Democrats against the measure: Reps. Carlos Curbelo, Mario Diaz-Balart and Ileana Ros-Lehtinen of Florida; Rep. Robert Dold of Illinois and Rep. Richard Hanna of New York.

The general party line has been that the deportation relief programs President Barack Obama announced in 2012 and 2014 are amnesty -- a buzzword used to refer to any and all policies not aimed at deportation. This unquestionably has become an issue of politics and policy.

Republicans have argued that their opposition to Obama's immigration programs is about protecting the Constitution. Texas led 25 other states in filing a suit against the federal government in the case, arguing the president overstepped his authority and was doing harm to states.

The Supreme Court will hear the case on April 18 and asked lawyers to argue not just over whether the states were able to sue, but also more broadly on whether Obama abdicated his responsibility to enforce the law, something lower courts had not definitively decided.

Either way the ruling goes, it could have major implications on the election and on the millions of undocumented immigrants who have been blocked from receiving the relief they were promised in 2014. Both Democratic presidential candidates have promised to expand deportation relief, and Republican front-runner Donald Trump has said he would kill the policies and seek mass deportation.

The resolution approved Thursday authorizes the House -- not members of Congress or the Republican conference, but the chamber as a whole -- to file an amicus brief siding with Texas. Democrats argued members were voting to approve something they had never seen, as the vote wasn't on an actual brief, but just to authorize the House to create one.

Ryan argued the brief was necessary because Obama violated the Constitution by failing to execute the laws and because Congress, not the president, makes laws.

"We must defend the principle of self-determination, of self-government, of government by consent of the governed," he said on the House floor.

The House has voted previously as a whole to get involved in litigation, most recently when it voted to sue the Obama administration over certain appropriations in Affordable Care Act funding. But congressional legal action is typically decided by a bipartisan legal advisory group, not by a vote of the full House. Ryan's office told reporters that the law firm of Paul Clement -- a renowned Supreme Court litigator -- was representing the House pro bono, and would likely ask the Supreme Court to participate in oral arguments.

"They keep saying, 'Well, Trump doesn't represent us, he doesn't [represent] our views, he doesn't represent our values,' and now they want to know where Trump gets all of his anti-immigrant, xenophobic ideas from. Try the House of Representatives." Rep. Luis Gutierrez (D-Ill.)

The main policy in question in the lawsuit is the 2014 Deferred Action for Parents of Americans and Lawful Permanent Residents, or DAPA, which would allow some undocumented parents to apply for temporary work permits and conditional status to remain in the country. The lawsuit also aims to block an expansion of the 2012 Deferred Action for Childhood Arrivals program, or DACA, which grants the same protections to certain undocumented immigrants who came to the U.S. as children. The first iteration of that program remains in effect, but its expansion has been blocked.

Obama said when he announced the programs that they were within the executive's authority for prosecutorial discretion, or how the Department of Homeland Security prioritizes its enforcement of the law given limited resources. The argument is that screening and approving some undocumented immigrants for deferred action on deportation would allow agents to focus on removing others, such as convicted criminals and national security threats.

It isn't an apolitical matter on the Democratic side, either: Presidential candidates Hillary Clinton, the former secretary of state, and Sen. Bernie Sanders (I-Vt.) both said they would go beyond DAPA and DACA to issue protections for an even broader group of undocumented immigrants.

Democrats have also gotten involved in the case, although in a crucially different way -- not on behalf of an entire chamber, but in groups. Senate Minority Leader Harry Reid (D-Nev.), House Minority Leader Nancy Pelosi (D-Calif.) and 223 other Democrats in Congress filed their own amicus brief earlier this month. Leaders from nearly 120 cities and counties did the same.

Rep. Luis Gutiérrez (D-Ill.) said on a call with reporters ahead of the vote that Republicans should take the same tack, if they want to get involved. He and other Democrats said Republicans were standing with Trump, whose rhetoric some of them have condemned, with the vote.

"The vote today is a political stunt disguised as a legal brief because the Republican majority sees a crass political opportunity to stand with the anti-immigration wing of their party," Gutiérrez said. "They keep saying, 'Well, Trump doesn't represent us, he doesn't [represent] our views, he doesn't represent our values,' and now they want to know where Trump gets all of his anti-immigrant, xenophobic ideas from. Try the House of Representatives."