Was the recent decision by Ukraine not to sign a major association agreement with the European Union a failure of EU foreign policy? Despite some understandable hand-wringing in Brussels, the answer must be a resounding “no.” While it is true that this week’s Eastern Partnership summit in Vilnius will now be unable to “deliver” Ukraine as the crown jewel of the European Neighborhood Policy, Europeans have gained much in the diplomatic wrangling of the last six months.

First of all, the fog has now lifted. There are no illusions left about the nature of the game in which the EU finds itself in its Eastern neighborhood. By bringing its own rather limited zero-sum logic to the issue, Russia successfully managed to upgrade the Eastern Partnership from a technocratic cooperation project into a geopolitical contest.

As recently as a few days ago, EU officials refused to look at the game over Ukraine that way. They insisted that Ukraine’s signing of an agreement with the EU would not constitute a defeat for the Kremlin, but that all parties would benefit in the long run. The officials are right, of course, and yet the game is being played differently for the time being. The EU had no choice but to finally understand that. It was forced to play hardball. And so it got its act together and did just that.

And that is the second reason why the outcome of the standoff is not an EU defeat. For the first time since the Eastern Partnership’s inception in 2009, the EU did not duck the challenge, but decided to accept it. It stood firm. It defended Ukraine’s right to make its own sovereign decision in the face of blatant Russian political blackmail of the leadership in Kiev. The EU lost the standoff when Ukrainian President Viktor Yanukovych caved in to Russian pressure, but it gained something more important: the EU did not compromise, but held its nerve.

The key to the EU’s steadfastness was Germany’s unexpectedly firm commitment to the cause. Getting Berlin on board for a principled position on the Eastern Partnership turned the initiative from a toothless pet project of Eastern and Northern EU member states into a pan-EU endeavor. When Germany attached itself to this cause, the project all of a sudden gained political and diplomatic weight.

In the end, German support was not enough to create the desired outcome. But again, the EU gained something even more important: Germany took the foreign policy lead on a very uncomfortable issue, one that involved standing up to Russia. Just last week, German Chancellor Angela Merkel spoke firmly in the Bundestag and put her weight behind the logic of the EU’s policy in the East. Observers took note of that across Europe—and certainly also in Russia.

It has been said that the EU made two fatal mistakes that brought about the failure of the association agreement with Ukraine. First, it should not have reinforced the Russian zero-sum logic by stating that Ukraine had to choose between the EU agreement and the Moscow-led customs union. By forcing Kiev to make a hard choice, the EU was undermining its own efforts. Second, the EU should not have tied the signing of the agreement to the release of former prime minister Yulia Tymoshenko, Yanukovych’s imprisoned archenemy.

There is a little bit of truth in both arguments, especially the latter. But ultimately, these EU positions were only minor factors in Kiev’s decision to abandon the deal.

The real reasons for Ukraine’s stance are more deeply rooted in the country’s domestic politics. The Ukrainian political elite, which for several years managed to steer a policy of equidistance between Russia and the West, decided that it was not yet time to abandon that model. For the oligarchs behind Yanukovych, getting too close to either Brussels or Moscow potentially endangers their business model, which is all about getting rich by keeping a monopoly of power in a fragile political environment.

Add to this the brutal political blackmail from Moscow, and you get a situation in which sticking to the status quo looked more attractive than risking a leap of faith into the arms of the EU.

Nothing is yet lost for the EU. It failed to secure the association agreement with Ukraine, but it emerges from the quagmire stronger than before. Not only has the episode been a healthy reality check, the EU also went through an enormous test of unity and came out intact.

Furthermore, Russia made it clear to the rest of the planet that the only way it can succeed in its neighborhood is not through the attractiveness of what it has to offer, but through blackmail and coercion. Not that this was entirely unknown before, but the utter crassness of the Ukraine case will make many governments in the region and elsewhere think twice about their dealings with Moscow.

And, perhaps most importantly, if the EU remains united and firm, time is on its side. Eventually, even Ukrainian oligarchs will realize that staying rich and living a better life is easier to achieve when allied with the West than with Russia.

All now depends on two things. First, the EU must keep the door open and not give up on Ukraine. The initial reactions from Brussels and elsewhere are encouraging in that respect. Second, the EU needs to eagerly do its homework and keep its integration and market model economically and politically attractive. If it can pull this off, it is quite clear who will prevail in the geopolitical contest over Eastern Europe in the long run.

And maybe, just maybe, it will also become clear to Russian decisionmakers that such an outcome is best for them, too. The foreign policy game over Eastern Europe has not been lost. It has only just begun.