All the complaints from the career national security establishment, however, carry little weight with Mr. Trump, who dismisses his critics as the same ones who got the country into a catastrophic war in Iraq. While that may not be true in all cases, Mr. Trump makes the case that 18 years after the attacks of Sept. 11, 2001, it is time to pull out even without extracting trade-offs in return.

“When I watch these pundits that always are trying to take a shot, I say — they say, ‘What are we getting out of it?’ ” Mr. Trump told reporters on Monday as he hosted a cabinet meeting. “You know what we’re getting out of it? We’re bringing our soldiers back home. That’s a big thing. And it’s going to probably work. But if it doesn’t work, you’re going to have people fighting like they’ve been fighting for 300 years. It’s very simple. It’s really very simple.”

The United States has about 200,000 troops stationed around the world, roughly half of them in relatively less dangerous posts in Europe or Asia where American forces have maintained a presence since the end of World War II. Tens of thousands of others are deployed in the Middle East, although only a fraction of them are in the active war zones of Afghanistan, Iraq and Syria.

It took only a few dozen Special Forces operators near the border in northern Syria to deter Turkey from assaulting America’s Kurdish allies there, but soon after Mr. Trump talked with Mr. Erdogan on Oct. 6 , the president announced on a Sunday night that they would be pulled back. Turkey then launched a ferocious attack on the Kurds, and by the time a convoy of American troops moved away over the weekend, they were shown in a widely circulated video being pelted by angry Kurds throwing potatoes to express their sense of betrayal.

Mr. Trump did not ask Mr. Erdogan for anything in exchange. Instead, the diplomacy came only after the Turkish incursion began when he sent Vice President Mike Pence and Secretary of State Mike Pompeo to Ankara to broker a cease-fire to give the Kurds time to evacuate a new safe zone to be controlled by Turkey along the Syrian border. Mr. Erdogan essentially got what he wanted.

In Afghanistan, Mr. Trump’s special envoy spent months negotiating a peace agreement with the Taliban militia that would provide guarantees that the country would not be used as a base for terrorist attacks against the United States if it reduced its troop presence to around 8,600. The talks fell apart, but Mr. Trump is drawing down American forces anyway, pulling out 2,000 troops in the last year, leaving 12,000 to 13,000 . Plans are to keep shrinking the force to around 8,600 anyway.