The Senate voted to sustain President Trump’s veto of a measure that would end U.S. involvement in the Yemen war.

Republicans mostly sided with Trump, preventing the two-thirds majority, or 67 votes, needed to override his veto.

It’s the second time Congress has voted to uphold Trump’s veto. The House in March sustained Trump’s veto of a bill that would have revoked his emergency declaration used to fund a southern border wall.

Trump issued the second veto in his presidency on April 17 when he signaled his opposition to the Yemen bill, which passed both the House and Senate earlier this year.

[Related: Pompeo rebukes senators who voted to end US involvement in Yemen civil war]

The measure was authored by Sen. Bernie Sanders, I-Vt., who is running for president and believes the U.S. military's involvement is unauthorized by Congress. It had the backing of seven Republicans.

The measure would prevent the United States from aiding Saudi Arabian air strikes in Yemen against the Iran-backed Houthis.

The Yemen war has created a significant humanitarian crisis and has caused millions to flee.

Supporters of the measure said it was needed to reset U.S. relations with Saudi Arabia, which has stepped up human rights violations against its citizens and some U.S. residents.

“The Saudis’ behavior has gotten far more outrageous, has crossed more human rights lines, has compromised the safety of more American citizens and yet no response from the United States,” Sen. Chris Murphy, D-Conn. said.

Foreign Affairs Committee Chairman Jim Risch, R-Idaho, said his panel is working to write a bipartisan measure to “put our relationship on the right trajectory,” with Saudi Arabia.

“What’s important is that we don’t just poke at this, but produce legislation that is bipartisan and can be signed by the president and become law,” said Risch.

[Opinion: What Trump's Yemen veto reveals about forever wars]