The Senate on Thursday rebuked President Trump by supporting language that calls on him to abandon U.S. troop withdrawals from Syria and Afghanistan.

The amendment to a foreign policy bill was offered by Senate Majority Leader Mitch McConnell, R-Ky., who called it an "opportunity for senators to go on the record about what our country should be doing in Syria and Afghanistan.”

His language needed 60 votes to advance, and the final vote was 68-23.

[Related: US withdrawal from Afghanistan requires Kabul government and Taliban to strike peace deal first]

Story continues below

McConnell's amendment sparked a debate over the role of the United States in the Middle East, which has been mired in conflict for centuries. Lawmakers who backed Trump’s December announcement that he would pull out troops noted that U.S. efforts to import democracy and stabilize Afghanistan have largely failed.

“I think he has rightfully identified that we should re-examine our nation-building efforts and expenditures in some areas,” said Senate Foreign Relations Committee Chairman Jim Risch, R-Idaho. “I think he’s right, there.”

But McConnell said it’s too soon to withdraw U.S. military presence and doing so would hurt important allies, and most senators agreed.

“I believe the threats remain,” McConnell said before the vote. “ISIS and al Qaeda have yet to be defeated, and American national security interests require continued commitment to our mission there.”

The amendment was passed as part of a Middle East security measure now on the floor that includes a provision allowing states to ban companies that support the Palestinian-backed boycott, divestment, and sanctions movement to boycott Israeli businesses.