“We’ve been in Afghanistan for a longer period than any war in American history; Syria, we’ve been there for too long and we’ve got to get out,” Mr. Sanders told reporters Thursday. “What McConnell is saying is, ‘Let’s maintain the status quo.’”

And virtually every senator considering a White House run voted against the McConnell resolution, including Mr. Sanders, Ms. Warren, Ms. Gillibrand, Cory Booker of New Jersey, Kamala Harris of California and Amy Klobuchar of Minnesota. Of the group, only Senator Michael Bennet of Colorado voted yes.

Still, the Senate’s support for the nonbinding amendment is one of the latest signs of an intensifying and bipartisan appetite to condemn the president’s foreign policy.

Senators Marsha Blackburn, a Tennessee Republican and Trump ally, and Tammy Duckworth, Democrat of Illinois, who lost both her legs when her Army helicopter was shot down in Iraq, wrote to the president on Thursday pressing him to develop “a comprehensive plan to protect our Kurdish partners serving in the Syrian Democratic Forces and prevent armed conflict between Kurdish forces and the Republic of Turkey.” Ms. Blackburn represents Nashville, which is home to more Kurdish-Americans than any other city in the United States.

In the House, Representatives Tom Malinowski, Democrat of New Jersey, and Mike Gallagher, Republican of Wisconsin, unveiled two bills on Wednesday that seek to bar the Trump administration from abruptly withdrawing troops from Syria and South Korea.

The bills prohibit the use of military funds to reduce the number of active-duty troops serving in Syria below 1,500 and below 22,000 in South Korea, unless the defense secretary, the secretary of state and the director of national intelligence submit assurances to Congress that the withdrawals would not undermine the nation’s security and that allied nations had been consulted, among other stipulations.