WASHINGTON – Despite a veto threat from the president, the Senate approved legislation Wednesday that would force the Trump administration to end its military support for the Saudi-led war in Yemen.

Wednesday's 54-to-46 vote served as a bipartisan rebuke to President Donald Trump and to Saudi leaders. It also highlighted lawmakers' growing unease with America's role in that grisly conflict, which has left more than 50,000 civilians dead and millions of Yemenis on the brink of starvation.

"The United States, with little media attention, has been Saudi Arabia's partner in this horrific war," Sen. Bernie Sanders, I-Vt., said during a Senate floor speech Wednesday. He is a lead author of the measure, which relies on a Vietnam-era law designed to limit the president's power to start or escalate military engagement abroad.

"We have been providing the bombs the Saudi-led coalition is using. We have been refueling their planes before they drop those bombs. And we have been assisting with intelligence," Sanders said. "In too many cases, our weapons are being used to kill civilians."

Sen. Mike Lee, a conservative Utah Republican who joined Sanders in sponsoring the measure, called the war "unconstitutional, unjustified and ultimately immoral." He said Congress must be involved in deciding if and when to put "American blood and treasure on the line" but lawmakers have abdicated that role in the Yemen conflict and others.

The measure is expected to pass the House in the coming weeks, and it could pose a difficult test for Trump. More than two years into his presidency, Trump has yet to use his veto power.

Trump has sought to end or limit America's costly military engagements across the globe, most notably in Syria and Afghanistan, often over the objections of his hard-line advisers.

The war in Yemen is a proxy battle between Saudi Arabia and Iran, as the two regimes battle for influence in the region. The Saudis, along with the United Arab Emirates, have engaged in a deadly bombing campaign against the Iranian-backed Houthi rebels. The war has created the world's worst humanitarian crisis. An estimated 85,000 children have died of starvation over the last several years, according to Save the Children.

Congressional support for ending the U.S. role in Yemen gained steam last year amid bipartisan outrage over the Saudi government's role in the murder of Jamal Khashoggi, a U.S. resident and Washington Post columnist who was brutally killed inside the Saudi Consulate in Istanbul. Lawmakers in both parties believe that Saudi Arabia's crown prince, Mohammed bin Salman, was complicit in Khashoggi's killing.

"The entire world received a very clear understanding of the nature of the Saudi regime with the murder of Jamal Khashoggi in the Saudi Consulate in Turkey," Sanders said. "All of the evidence suggests that the Saudi crown prince was directly responsible for that murder. Is that the kind of regime whose lead we should be following?"

Republican opponents of the Yemen resolution agreed that the Saudis' actions in that incident, and its conduct in the war, has been troubling. But they argued that limiting U.S. involvement in Yemen would give Iran a green light to spread its influence in Yemen and set a dangerous precedent by stretching the 1973 War Powers Act definition of military engagement.

GOP lawmakers have noted that the Trump administration already halted its refueling of Saudi jets last fall. They argued that the U.S. role now – which involves providing logistical, intelligence and targeting assistance – did not amount to using American military force.

"We’re not engaged in hostilities in Yemen," Sen. James Inhofe, R-Okla., the chairman of the Armed Services Committee, said during Wednesday's debate. He said the U.S. assistance has helped reduce civilian casualties and protect humanitarian aid workers. It's also vital to preserving American leverage with the Saudis as the United Nations tries to broke a peace agreement.

In its February veto threat, the Trump administration said the measure was "flawed" and would impinge on the president's constitutional powers as America's commander in chief. The White House said it would also "harm bilateral relationships" in the Middle East and hurt America's efforts to stamp out violent extremist organizations such as the Islamic state.

The House easily passed a similar bill earlier this year, but Republicans added an amendment calling for the U.S. to combat anti-Semitism around the world, a provision aimed at rebuking Rep. Ilhan Omar, D-Minn., for a tweet that many denounced as anti-Semitic.

The Senate resolution doesn't include that language, so the House will have to vote again on the narrower proposal. But proponents said they're confident it will pass the House again in the coming weeks – marking first time Congress has invoked its war powers to challenge U.S. military involvement abroad.

Even if Trump vetoes the measure, supporters said it would be a historic moment and would send an important message about Congress' willingness to reassert its role in declaring war.

It's "going to set a precedent: No more unconstitutional wars," said Rep. Ro Khanna, D-Calif., the lead author of the House Yemen bill. "And it's going to make future commanders of chief think twice before undertaking interventions" in far-flung places where U.S. national security interests are questionable.

But Khanna said he's holding out hope that Trump will sign the measure, despite the veto threat.

Vetoing it "goes against his instincts to pull us out of these foreign military interventions," Khanna said. "And if he signs it, he can help take credit for ending a terrible war which started frankly before he even assumed office."

More:Lawmakers revive push to hold Saudi Arabia accountable for Jamal Khashoggi murder

More:Jamal Khashoggi's murder was a human rights violation by Saudi government, State Department says