The House voted Friday to prevent President Trump from going to war with Iran without congressional approval, after more than two dozen Republicans joined Democrats to include the provision in the House’s annual defense authorization bill.

The move sets up a showdown with the Senate over whether the Iran restriction, which includes an exception for cases of self-defense, will be included in the final bill negotiated between the two chambers.

Republican leaders have argued that the move communicates to Tehran that the United States is divided, which could complicate Trump’s ability to manage escalating tensions. Last month, the president authorized, then called off an airstrike in response to Iran downing a U.S. surveillance drone.

The GOP-led Senate voted down a similar effort to include Iran language in its defense bill last month. But in the Democratic-led House, the Iran measure was one of several that were vital to securing support from liberal members, who had warned they might vote against the must-pass legislation.

Friday’s final vote, 220 to 197, was a crucial victory for House Speaker Nancy Pelosi (D-Calif.), after liberal Democrats revolted late last month over being asked to accept a Senate-negotiated border spending bill that omitted their key demands. The annual defense bill, which typically does not enjoy broad support from the party’s left, was seen as a major test of whether the fissures between Democrats would persist.

In the end, only eight Democrats opposed the bill, including the four freshmen who have sparred most openly with Pelosi: Reps. Alexandria Ocasio-Cortez (N.Y.), Ilhan Omar (Minn.), Ayanna Pressley (Mass.) and Rashida Tlaib (Mich.).

“The big picture is, it shows we’re together,” said House Majority Leader Steny H. Hoyer (D-Md.) said. “This bill, it was a tough number for a lot of people, but what they were saying was: They wanted to have us unified.”

Though several Republicans supported various amendments, none ultimately voted for the overall defense bill, which GOP leaders called a “shameful” attempt to play politics with a traditionally bipartisan measure.

“Our national security is not a game. But that is exactly how Democrats are treating it,” House Minority Leader Kevin McCarthy (R-Calif.) said.

House Armed Services Committee Chairman Rep. Adam Smith (D-Wash.) retorted that “to say we don’t care about national security . . . is a baldfaced lie.”

“Our bill isn’t just good, it’s better than the ones that the Republican Party has put together, because we believe the Pentagon should be accountable,” Smith continued.

At the heart of the partisan dispute is a disagreement over the Pentagon’s budget: Republicans and the Trump administration want a $750 billion authorization, which is what the Senate approved last month, while the House’s bill clocks in at $733 billion — a figure that Smith argued military leaders endorsed previously.

Liberal Democrats tried, but failed, to reduce that number even further Friday, with an amendment to strip $16.8 billion in war funding from the bill. The House also voted against measures from Reps. Sylvia Garcia (D-Tex.) and Ocasio-Cortez to prevent defense money and facilities from being used to house migrant children and undocumented immigrants. Members endorsed a measure from House Homeland Security Committee Chairman Rep. Bennie Thompson (D-Miss.) to block defense dollars from being used to house foreign nationals detained by Immigration and Customs Enforcement.

Members endorsed a repeal of the 2002 Authorization for the Use of Military Force that was passed to approve the Iraq invasion, and a statement that the 2001 AUMF, adopted after the 9/11 attacks, ought to be replaced with a time-limited measure.

They also voted in favor of suspending for one year the sale of air-to-ground munitions to Saudi Arabia and the United Arab Emirates, one of several efforts in the bill to deny weapons and limit U.S. support for Saudi-led military operations in Yemen’s civil war.