Donald Trump beamed with pride yesterday announcing a “cease-fire” agreement in Turkey negotiated by a U.S. delegation. The American president wrote on Twitter, “This is a great day for civilization. I am proud of the United States for sticking by me in following a necessary, but somewhat unconventional, path.”

Trump seemed blissfully unaware of his own failure. He created the crisis, inviting Turkey to launch a ruthless offensive against our Kurdish allies, which the Republican resolved by giving Turkey everything it wanted in exchange for practically nothing. The New York Times’ analysis of yesterday’s developments served as a brutal wake-up call for the confused American president.

The cease-fire agreement reached with Turkey by Vice President Mike Pence amounts to a near-total victory for Turkey’s president, Recep Tayyip Erdogan, who gains territory, pays little in penalties and appears to have outmaneuvered President Trump. The best that can be said for the agreement is that it may stop the killing in the Kurdish enclave in northern Syria. But the cost for Kurds, longtime American allies in the fight against the Islamic State, is severe: Even Pentagon officials were mystified about where tens of thousands of displaced Kurds would go, as they moved south from the Turkey-Syria border as required by the deal — if they agree to go at all. And the cost to American influence, while hard to quantify, could be frightfully high.

A Turkish official told the Washington Post that his country’s officials who participated in the talks were “surprised and relieved at how easy the negotiations were.” The official added, “We got everything we wanted.”

By any fair measure, that’s unambiguously true. Turkey initially got to slaughter Kurds at the invitation of the American president. As the violence unfolded, Turkey then got the United States to agree to a “deal” in which Turkey will (a) gain control of Kurdish land in northern Syria, (b) face no U.S. sanctions, and (c) receive a diplomatic reward in the form of a White House visit for President Recep Tayyip Erdogan. It’s also an agreement that delights Russia and ISIS.

As for the American side of the ledger, we get nothing, except diminished credibility

It is, in other words, an embarrassing failure for the Trump administration – except Trump doesn’t seem to know that.

On the contrary, the Republican seems to believe he’s done something extraordinary, describing the one-sided deal as “amazing” yesterday afternoon. Trump even went so far as to seemingly endorse ethnic cleansing, telling reporters of the Turks’ efforts to rid northern Syria of the Kurds, “[T]hey had to have it cleaned out.”

At a campaign rally in Dallas last night, Trump added that American presidents have wanted this deal for “15 years,” which foreign policy experts agree “does not make any sense at all.”

What’s more, it’s not at all clear that the crisis Trump helped create is over. For one thing, the Kurds that the American president sold out suddenly have nowhere to go, and no one seems to know where they’ll flee to or how they’ll get there.

For another, despite the purported “cease-fire” agreement, the fighting continues in northern Syria, Trump’s misguided triumphalism notwithstanding. The terms of the “deal” apparently didn’t quite make it a full day.