Congress has officially passed a resolution to end US support for the war in Yemen, a strong rebuke of President Donald Trump’s foreign policy toward Saudi Arabia.

Trump has pledged to veto the resolution.

The war in Yemen, directed by Saudi Crown Prince Mohammed bin Salman (or MBS, as he’s commonly referred to in Washington), has killed more than 50,000 people and left more than 20 million Yemenis in need of humanitarian assistance.

The US helps the Saudi-led coalition, which also includes the United Arab Emirates and several other Gulf Arab and African countries, by providing them with intelligence, selling them arms and ammunition, and, until late last year, fueling warplanes.

That means the US is partially culpable for the death and destruction of Saudi’s enemies in the war — the Iranian-backed Houthi rebels — and the thousands of civilians who have been killed. In one particularly egregious incident, a coalition warplane bombed a school bus full of children last August with an American-made bomb, killing at least 40 of them.

The Yemen resolution invokes the War Powers Resolution of 1973 (WPR), which gives Congress the power to direct a president to remove troops involved in “hostilities” abroad if there has been no formal “declaration of war or specific statutory authorization” from Congress.

Not only does it serve as a censure of Saudi’s conduct in the war, it’s also a clear check on executive power; if the US wants to be involved in a war in Yemen, Congress has to declare it. The Republican-led Senate passed the resolution in March, and it now heads to Trump’s desk. The White House says the president plans to veto it.

Nonetheless, that the resolution has passed signals a significant shift in Congress around Saudi Arabia. Getting it done took intense progressive antiwar activism and a rare bipartisan coalition of progressive and conservative lawmakers to claw back war-approving authority from the president and end US participation in a war that has created one of the world’s worst humanitarian disasters.

Trump really didn’t want this to happen

Progressive lawmakers, including Sen. Bernie Sanders (I-VT) and Rep. Ro Khanna (D-CA), have been pushing to get this done for years. But the war powers resolution really caught bipartisan steam last year — closely tied to the shock and outrage over the killing of Saudi journalist, dissident, and American resident Jamal Khashoggi and Trump’s sympathetic response to Saudi interests.

Khashoggi was killed and allegedly dismembered last October inside Saudi Arabia’s consulate in Istanbul. Lawmakers, many of whom have historically backed the US-Saudi relationship, are angry about the killing. In October, Sen. Lindsey Graham (R-SC), a staunch Trump ally, said he felt “completely betrayed” by Riyadh.

Since then, the White House, top administration officials, and Saudi lobbyists, who are well established in Washington, have been working hard to build support for continued US involvement in the Yemen war.

In March 2018, then-Defense Secretary Jim Mattis claimed that stopping US support “could increase civilian casualties, jeopardize cooperation with our partners on counterterrorism, and reduce our influence with the Saudis — all of which would further exacerbate the situation and humanitarian crisis.” However, in October, Mattis also pushed for a negotiated peace deal to end the fighting — a peace deal that remains elusive.

Meanwhile, Trump has repeatedly emphasized his support for MBS, calling him a “great ally.” In March, reports showed that the United States approved six secret authorizations to sell Saudi Arabia nuclear power technology, which both Democratic and Republicans lawmakers have warned could aid a nuclear arms race in the Middle East.

Republican leaders repeatedly tried to weaponize anti-Semitism to stop this vote

House and Senate Republican leaders have worked hard to protect Trump’s interests with Saudi Arabia and try to stop this war powers resolution from making its way to Trump’s desk. Last year, under Paul Ryan’s leadership, House Republicans blocked a vote on the resolution altogether, despite similar measure passed in the last GOP-controlled Senate.

When Democratic leaders came into control and made the Yemen resolution a priority (Majority Leader Steny Hoyer is a co-sponsor, as was Nancy Pelosi last year, before she was speaker), Republicans continued their campaign to stall the process by trying to weaponize anti-Semitism against Democrats.

In February, after Minnesota progressive Rep. Ilhan Omar’s comments about the pro-Israel lobby group AIPAC and Israel-US relations, which both Republican and Democrats decried as anti-Semitic dog whistles, Republicans added an amendment to the Yemen resolution condemning anti-Semitism. Democrats voted in favor of the seemingly innocuous provision.

But the Republican amendment proved to be in bad faith. Because the amendment was not relevant to the core text of the resolution, Senate Majority Leader Mitch McConnell used procedural rules to block the Senate’s vote on the House version of the resolution, forcing the legislative process back to square one.

Seeing that the procedural gimmick worked the first time, House Republicans tried it again in the final vote, bringing up the same resolution to censure Omar and put Democrats in a difficult spot: To pass the final resolution, Democrats first had to vote to reject adding a pro-Israel amendment against the Boycott, Divestment, and Sanctions (BDS) movement — a push to boycott Israel.

“They are playing games with a bill that speaks to the horrific situation in Yemen and I just don’t think you can play politics,” Rep. Jim McGovern (D-MA), who chairs the House Rules Committee, told Vox of the maneuver. “If they don’t want to support the bill, that’s fine, but Republicans are going to be Republicans. They are not interested in constructive legislating. They’re interested in playing ‘gotcha.’ They are interested in putting people on the spot.”

This time, however, Democrats — at the urging of leadership and activists — didn’t fall for Republicans’ gambit.

“As a Jew with a sprawling extended family in greater New York, I can say that most of my family and Jewish friends would be appalled at the notion that concerns about anti-Semitism are being exploited to justify the continued perpetration of atrocities against untold numbers of Yemenis,” David Segal, the executive director of Demand Progress, one of the activist groups fighting for this vote, told Vox — a message they sent loud and clear to Democratic lawmakers.

Hoyer said the move made Israel a “partisan cudgel” and called it “cynical and dangerous” on the House floor.

One Democratic lawmaker told Vox they’d suggested to Democratic leadership staff that House Democrats start every week with a resolution against anti-Semitism, just to preempt any Republican attempts to block the House’s agenda.

“It was half in jest,” the lawmaker said.