Russian President Vladimir Putin wants to divide NATO. President Donald Trump is doing that for him.

Here’s a quick rundown of some of the things Trump did when he arrived at the NATO summit this week:

He blasted allies for not spending enough on defense, calling them “delinquent” and even suggesting they double their commitments.

He repeatedly interrupted NATO Secretary-General Jens Stoltenberg, at one point making Stoltenberg praise him.

He insulted Germany, calling it a “captive to Russia” because it imports energy from the country.

And all of that took place at the opening breakfast of the two-day summit. It just got worse from there.

Trump arrived 30 minutes late to a meeting on Russian aggression, skipped at least two scheduled meetings with world leaders, and threatened to “go it alone” if European allies didn’t pay more, seeming to suggest he might pull the US out of NATO.

Things got so bad that Stoltenberg canceled Thursday afternoon’s meetings to call an emergency session to hear out Trump’s concerns.

Trump ultimately declared the summit a success in a bizarre impromptu press conference shortly after, claiming he got allies to pay up for defense and declaring himself “a very stable genius.” (French President Emmanuel Macron disputes that NATO countries agreed to Trump’s demands.)

But it was too little, too late. “The damage had already been done,” says Rachel Rizzo, a European security expert at the Center for a New American Security think tank. Close US allies were insulted, the stability of the alliance was shaky, and the US commitment to the defense of Europe was uncertain at best.

Putin couldn’t have orchestrated it better himself.

Putin wants to undermine and divide NATO

NATO, which stands for the North Atlantic Treaty Organization, was formed in 1949 by the United States, Canada, the United Kingdom, France, and several other European countries. The goal was to create a powerful military alliance to contain Soviet expansionism after World War II.

While NATO leaders probably wouldn’t say this publicly, the alliance still exists mainly as a way to deter Russian aggression on the European continent. The alliance’s Article 5 provision, which states an attack on one is an attack on all, helps to keep Moscow from invading any of NATO’s 29 members, especially those in Eastern Europe. Indeed, if Putin ordered an invasion of, say, Estonia, then the US would be treaty-bound to come to Tallinn’s aid. Putin, surely, doesn’t want to start a war with America.

So instead of all-out war, Putin has long tried to divide and undermine the NATO alliance. For instance, he’s interfered in the elections of NATO members in favor of pro-Russia candidates held large-scale military exercises on the alliance’s eastern flank. Threatening NATO political and militarily leads allies to question their own security the commitment of their friends.

It’s one thing for the president of Russia to actively undermine a military alliance that basically exists to thwart his ambitions. It’s another thing entirely when the president of the United States does it.

To be fair, the Trump administration has done a few things to strengthen NATO. It’s increased the number of US troops to Eastern Europe and upped financial help for Europe’s defense.

But Trump’s behavior at the summit is still really bad for NATO, mostly because he keeps attacking allies — dividing the alliance in a way Putin only wishes he could.

“Putin wants to find cracks in this alliance, and he wants to crawl into those cracks and live in those cracks in order to spread them further,” retired Air Force Gen. Philip Breedlove, NATO’s top military commander from 2013 to 2016, told me. “We don’t need to be building those cracks for him.” Breedlove doesn’t believe Putin necessarily came out on top during the summit, but still thinks there’s a better way for Trump to interact with America’s allies.

How Trump could make it even worse

Trump is flying to Helsinki on July 16 to sit down with Putin for a one-on-one meeting — and experts and NATO allies are afraid that Trump might end up agreeing to things in that meeting that would be good for Russia but bad for the US and NATO.

For instance, Putin could capitalize on Trump’s anger over how much the US spends to defend Europe and his desire for a closer relationship with Russia to convince Trump to suspend NATO military exercises, arguing they cost too much and antagonize Russia.

But that would send shivers down the spines of America’s NATO allies, who view those training exercises as a strong deterrent against Russian aggression.

“Putin doesn’t have to overplay it. He could sympathize with Trump about how NATO is useless, a Cold War relic that is encroaching on Russia’s borders, stirring up trouble,” Jill Dougherty, a Russia expert at the University of Washington, told me. “And he will sit back and watch Trump tear the alliance apart.”

Trump could also recognize Crimea — which Putin illegally seized in 2014 — officially as part of Russia. In June, Trump reportedly told leaders at the G7 summit in Quebec that Crimea might as well belong to Russia because the majority of people there speak Russian — a talking point straight out of the Kremlin.

This would be a huge win for Putin and a massive betrayal of America’s European allies. It would effectively end four years of united US and European policy to push back on Russia’s incursion. If Trump gives up on that push back, it could lead allies to wonder Trump’s commitment to broader European security.

It’s unclear if Trump would agree to any of these things, but it’s a real possibility. On Thursday, reporters at the NATO summit asked Trump if he’d consider canceling NATO military exercises if Putin asked him to. Trump declined to give a definitive answer, merely replying, “Perhaps we’ll talk about that.”

That fact alone — that he wouldn’t rule it out even after spending two days with NATO allies — is the clearest sign of all that Putin has won big.