Following a last-ditch lobbying effort by the Trump administration, the Senate narrowly rejected a measure condemning a $500 million weapons sale to Saudi Arabia, which is engaged in a brutal bombing campaign in Yemen.

During his visit to Saudi Arabia, President Donald Trump praised the war in Yemen and signaled his intention to make a total $110 billion weapons package to the Persian Gulf kingdom. That prompted Sens. Chris Murphy, D-Conn., Rand Paul, R-Ky., and Al Franken, D-Minn., to introduce a resolution of disapproval against the sale of precision-guided weapons, pointing out that Saudi Arabia had used U.S. weapons to target civilians in Yemen. The resolution would have forced the Senate to vote on whether to block the transfer.

The measure, however, failed by a narrow margin of 47 to 53. The vote was much closer than a similar measure in September, which failed 71 to 27.

While the resolution went down in defeat, the increased vote total represents a shift in official Washington’s approach to the Middle East. With turmoil in Syria and 2015’s nuclear deal with Iran, the orthodoxies of Middle East policy — including turning a blind eye to rights abuses by U.S. allies — are being overturned. Tuesday’s proposed measure was presented by a bipartisan coalition of Republican libertarians and liberal Democrats.

Many of these shifts, however, are appearing on partisan fault lines. On Tuesday, only five Democrats voted against the resolution — Virginia’s Mark Warner, Missouri’s Claire McCaskill, West Virginia’s Joe Manchin, Florida’s Bill Nelson, and Indiana’s Joe Donnelly.

Some prominent Democrats who had voted against the September bill changed their tunes on Tuesday. Senate Minority Leader Chuck Schumer, D-N.Y., and Senate Foreign Relations Committee ranking member Ben Cardin, D-Md., both came around to supporting the measure of disapproval against the arms sales.

Cardin told The Intercept that many Democrats changed their vote because they didn’t see a commitment from Trump to end the conflict. “The main reason is we don’t see from President Trump,” he said, “a foreign policy that ends this conflict and the humanitarian crisis it’s causing.”

Sen. Sherrod Brown, D-Ohio, was also one of the Democrats who flipped in favor of the Murphy-Paul bill. “We know more and more what’s happening in Saudi Arabia,” he said, explaining his shift. Sen. Jeff Merkley, a Democrat from Oregon and one of the Senate’s most dovish lawmakers, surprisingly opposed the Murphy-Paul measure in September. But he voted in favor of it this time. “It’s becoming increasingly clear that Saudi Arabia has been deliberately targeting civilian targets,” he explained to The Intercept. “And that’s absolutely unacceptable, so as that became clear that’s why I wanted to help send this message.”

Murphy and Paul made a strong push for their measure in the run-up to the vote. Paul, in particular, took to the Senate floor with an image of a starving Yemeni child, pointing to the growing famine as a result of the war.