It was the summit the world spent months dreading — and President Trump walked out of it bragging he'd just pulled off the diplomatic deal of the century.

Trump, Vladimir Putin and Xi Jinping sat down together for the first time ever Thursday, huddling for 90 minutes at an exclusive resort in the Chinese tech hub of Shenzhen and emerging with a "joint declaration of peace" that sent shockwaves from Kyiv to Capitol Hill.

"Nuclear war cannot be won and must never be fought," the three leaders declared in a joint statement that also promised to pump more oil, "reform the UN" and rein in the International Criminal Court.

It was the kind of photo-op autocrats dream of — three of the most powerful men on the planet, shoulder to shoulder, rewriting the world order on their own terms.

'A great and highly consequential trip'

Trump, flying home on Air Force One, couldn't contain himself.

"A great and highly consequential trip," he crowed on social media, announcing a Friday news conference at the White House to crow about it some more.

The president also let slip the tell — the kind of detail that will have hawks in Washington reaching for the Maalox. He greeted Putin as "my friend" and described his relationship with Xi as "very special."

Republican Senator John Curtis, a member of the Senate foreign relations committee, didn't mince words.

"Vladimir Putin and Xi Jinping are not our friends," Curtis said. "We should not treat them as though they share our values or interests. Doing so risks undermining our national security."

The Putin playbook

While Trump was busy beaming, Putin was working the room like a pro.

The Russian strongman called the meeting "an important chapter in the history of diplomacy" — then promptly blew up the peace-talks narrative by vowing "far more painful" retaliation for Ukrainian strikes on the bridge to Crimea.

As Putin stood at his lectern in Shenzhen claiming to be ready for peace, his drones were raining down on Kyiv.

There was, of course, no mention from the Kremlin leader of nearly five years of Russian missiles obliterating Ukrainian power plants, bridges and apartment blocks.

Xi plays the host

For Xi, it was a triumph on a silver platter.

The Chinese leader sat at the center of the world's most powerful triumvirate, casting Beijing as the indispensable power broker while Washington and Moscow played along.

"Positive interaction among major powers is not a matter of choice, but a mandatory requirement," Xi said — a not-so-subtle dig at the West's years of trying to isolate both Russia and China.

State broadcaster CCTV called the huddle "positive, constructive, and highly productive," with Xi invoking the countries' shared history "fighting side-by-side during WW2."

Yalta 2.0?

Putin couldn't resist the comparison to the 1945 Yalta Conference, where Stalin, Roosevelt and Churchill carved up the postwar world.

"Nobody divided up the world at Yalta," he insisted, before delivering the kicker: "When it comes to today's conflicts, the realities on the ground will have to be accepted."

Translation: Ukraine, take your medicine.

Kyiv won't like it. Neither will the NATO allies who've spent years arming the Ukrainians. But Trump was undeterred.

"We feel the opposite" of past leaders who avoided talking to adversaries, the president declared — a line that's either the dawn of a new détente or the start of the biggest sellout since Munich.

The Iran threat

Trump did find one crowd-pleaser: Iran.

"We're not going to let Iran have a nuclear weapon," he said, calling the trilateral "uniquely positioned" to choke off nuclear proliferation.

It was the only line that drew bipartisan nods back home — small comfort for the lawmakers watching the commander-in-chief glad-hand the two men most responsible for trying to bury American influence abroad.

The Shenzhen summit was, by all accounts, Putin's idea — and Russian newspapers were already calling it a "diplomatic victory" before the leaders had even left the room.

For a man the West has spent years trying to lock in a freezer, that's the ultimate revenge.