WASHINGTON (AP) — The Senate on Tuesday narrowly turned back a bipartisan bid to rebuke Saudi Arabia and reject President Donald Trump’s plan to sell the kingdom more than $500 million in precision-guided munitions, sparing the new Republican administration an embarrassing defeat.

The vote Tuesday was 53-47, clearing the way for the sale to be finalized. The precision munitions are part of Trump’s proposed $110 billion arms package to Riyadh, which the administration said would create U.S. jobs while also improving a key ally’s military capability.

But opponents of the deal, led by Sens. Rand Paul, R-Ky., and Chris Murphy, D-Conn., have been sharply critical of Riyadh’s role in Yemen’s civil war and the kingdom’s human rights abuses. They said they feared the sophisticated weapons could be used in the conflict against Yemeni civilians.

Despite coming up short, Murphy declared a partial victory as the resolution of disapproval secured 20 more votes than did a similar measure he and Paul authored in September to stop the sale of more than $1 billion worth of American-made tanks and other weapons to Saudi Arabia.

“Today’s vote total would’ve been unthinkable not long ago, but Congress is finally taking notice that Saudi Arabia is using U.S. munitions to deliberately hit civilian targets inside Yemen,” Murphy said.

Paul, who challenged Trump for the GOP presidential nomination as a leader of the party’s non-interventionist wing, sharply criticized Saudi Arabia during remarks on the Senate floor. He called Riyadh the “No. 1 exporter of Jihadist philosophy” and said the munitions sale threatens the lives of innocent Yemenis.

“I am embarrassed that people would bring up trying to feather the nests of corporations in order to sell these weapons,” Paul said. “Saudi Arabia is not a reliable ally.”

Senate Majority Leader Mitch McConnell, R-Ky., and other senators supporting the sale said the United States can’t deny its Middle East allies the weapons they need to combat Islamic State extremists and check Iran’s aggression in the region.

The war in Yemen is pitting the country’s internationally recognized government and a Saudi-led coalition against the Iranian-backed Shiite rebels known as Houthis, who are allied with army units loyal to a former president. The Saudi-led coalition, which is supported by the United States, has been carrying out airstrikes in Yemen since March 2015, and thousands of civilians have been killed in the fighting, according to the U.N.

Sen. Lindsey Graham, R-S.C., said rejecting the sale of precision munitions to Saudi Arabia would be a victory for Iran.

“If you don’t think containing Iran and keeping them from toppling Yemen, Iraq, Syria (and) Lebanon is not in our national interest, you’re making a huge mistake,” he said.

Sen. Bob Corker of Tennessee, the Republican chairman of the Foreign Relations Committee, suggested that at least a portion of the votes to block the munitions sale came from senators who wanted to embarrass Trump.

“I’m afraid this vote is somewhat about some members wanting to get a piece of President Trump’s hide,” Corker said.

Trump’s decision to move ahead with the sale appeared to reverse an Obama administration decision to hold sales of precision-guided munitions to Saudi Arabia’s armed forces after a Saudi airstrike on a funeral in Yemen last year killed more than 140 people.

___

Contact Richard Lardner on Twitter: http://twitter.com/rplardner