In a defiant speech built on questionable analysis and a few outright falsehoods, President Donald Trump declared diplomatic and strategic victory in northern Syria on Wednesday after Turkish and Syrian Kurdish leaders promised to hew to a permanent ceasefire.

Trump claimed credit for it all — for his snap decision to withdraw U.S. troops from the area after Turkey’s Recep Tayyip Erdoğan vowed to attack U.S.-backed rebel groups, which he and administration officials say has defused a longstanding conflict between two warring factions, forced regional players to manage their own security, and removed U.S. troops from an unnecessary intervention — all without spilling additional American blood.

But the entire premise of the president’s speech was sharply rejected by Republican and Democratic lawmakers who called Trump’s actions a shameful capitulation to Moscow and ISIS.

Trump also announced that “a small number of U.S. troops” would remain in northeastern Syria to protect oil-related sites while his team determines how to withdraw the balance of a U.S. force that until recently numbered around 1,000. Republican lawmakers had reportedly pressed Trump to keep some forces there, some walking him through a map of the country.

“This was an outcome created by us, the United States, and nobody else, no other nation. Very simple. And we're willing to take blame, and we're also willing to take credit,” the president said in the White House’s Diplomatic Room.

Related: We’re Still In the Fight, Trump’s Syria Envoy Tells Congress

Trump read slowly from a prepared statement, stopping at times to praise himself and scold his national-security critics for doubting his decision, which he said succeeded where decades of previous U.S. policy in the Middle East had failed. Trump scoffed at a proposal to send a larger U.S. force to help America’s Syrian Kurdish partners to face down Turkish troops.

“I don’t think so,” Trump said, noting Turkey is a NATO ally and claiming that the United States has a “very good relationship” with Erdogan.

“The same people that I watched and read — giving me and the United States advice — were the people that I have been watching and reading for many years. They are the ones that got us into the Middle East mess but never had the vision or the courage to get us out. They just talk,” he said. “How many Americans must die in the Middle East in the midst of these ancient sectarian and tribal conflicts? After all of the precious blood and treasure America has poured into the deserts of the Middle East, I am committed to pursuing a different course — one that leads to victory for America.”

“Through much work, we have done things that everybody said couldn’t be done. Today’s announcement validates our course of action with Turkey that only a couple of weeks ago were scorned, and now people are saying, ‘Wow. What a great outcome. Congratulations.’ It's too early to me to be congratulated, but we've done a good job. We've saved a lot of lives.”

Trump did not mention the hundreds of Kurdish fighters and civilians allegedly killed by Turkish-backed forces in the wake of his Oct. 8 phone call with Erdogan. But he thanked Mazlum Abdi, who leads the rebel Syrian Democractic Forces, for understanding his plans.

Just after the president finished speaking, Mazlum issued a carefully worded statement on Twitter: “We THANK President Trump for his tireless efforts that stopped the brutal Turkish attack and jihadist groups on our people.”

Nor did Trump address concerns, including ones expressed by fellow Republicans, that he had ceded land and influence to dictators in Turkey, Syria, and Russia.

Sen. Lindsay Graham, R-S.C., said in a statement that he wants the U.S. to “continue to control the skies over Syria” and continue to keep “a small but capable” force with the SDF. “I do not trust or believe that Turkey, Russia, or Assad have the capability or the desire to protect America from radical Islamic threats like ISIS.”

Sen. Marco Rubio, R-Fla., without directly criticizing Trump, said in a tweet, “Erdogan has NOT agreed to stop all military operations in #Syria.” He predicted that Russia would remove Kurdish forces from areas beyond the Turkish border zone, including from Kurdish-majority cities.

Democrats were more direct. Senate Foreign Relations Committee Chairman Bob Menendez, of New Jersey, said in a statement: “As if clearing the way for a campaign of ethnic cleansing against Syrian Kurds wasn’t enough, President Trump seems determined to keep handing political and military victories to Russia and Syria, kowtowing to Turkey, and opening the door for further Iranian expansion in the region. Today, the murderous Syrian regime and the Russian security forces continue to rejoice over their control of almost all remaining autonomous Kurdish territory, in some cases literally standing in abandoned American military posts. It is inconceivable that a self-described ‘deal-maker’ would lift sanctions on Turkey without any kind of concrete commitments that their ceasefire will be permanent.”

“The only question remaining is whether President Trump is acting directly at the behest of Russian and Turkish leaders, or whether he is willfully blind to his own failures. Today’s press conference of President Trump standing over the smoldering wreckage of our Syria policy and American leadership to declare victory is the epitome of his devastating approach to our national security,” Menendez continued.

Sen. Chris Van Hollen, D-Md., tweeted, “Trump’s celebration of the Putin-Erdogan deal represents his total surrender of American leadership and the treacherous betrayal of our Syrian Kurdish allies. It is also a recipe for the resurgence of ISIS. Congress must fill the leadership void.”

A senior administration official, speaking on background on a post-speech conference call with reporters, said that “the goal is to have all American troops out of Syria.” The official did not say how many would stay behind, where, and for how long, nor where the withdrawn forces would head next. “Some will go to Iraq, some will go to other places,” the official said.

Turkey and Russia announced Tuesday they would begin joint patrols of territory once held by U.S. and the Syrian Democratic Forces, or SDF, while Syrian forces would begin removing any fighters with the YPG, an element of the SDF.

“Turkey, Syria, and all forms of the Kurds, have been fighting for centuries,” Trump said. “We have done them a great service, and we've done a great job for all of them. And now we're getting out. A long time. We were supposed to be there for 30 days; that was almost 10 years ago. So we're there for 30 days, and now we're leaving. It was supposed to be a very quick hit and let's get out. And it was a quick hit, except they stayed for almost 10 years. Let someone else fight over this long-bloodstained sand.”

It’s unclear to what point 10 years ago Trump was referring; the U.S. returned to fight ISIS in Iraq and into Syria in 2013.

The president then turned toward wider U.S. policy toward the Middle East. He recalled his campaign pledge to withdraw from the region’s conflicts, and said that previous U.S. leaders who chose intervention also want “open borders” for the migrants fleeing those conflicts.

“Across the Middle East, we have seen anguish on a colossal scale. We have spent $8 trillion on wars in the Middle East, never really wanting to win those wars. But after all that money was spent and all of those lives lost, the young men and women gravely wounded — so many — the Middle East is less safe, less stable, and less secure than before these conflicts began,”he said. “The same people pushing for these wars are often the ones demanding America open its doors to unlimited migration from war-torn regions, importing the terrorism and the threat of terrorism right to our own shores. But not anymore. My administration understands that immigration security is national security.”

Trump said he no longer would allow the U.S. military to become “depleted, fighting in areas of the world where we shouldn’t be. When we commit American troops to battle, we must do so only when a vital national interest is at stake, and when we have a clear objective, a plan for victory, and a path out of conflict. That’s what we have to have. We need a plan of victory. We will only win. Our whole basis has to be the right plan, and then we will only win. Nobody can beat us. Nobody can beat us.”