Few countries have a better case for sovereign government and the rule of law than Ukraine. Even today you can take a short ride from the capital Kiev, as I did a couple of weeks ago, and speak to villagers who still remember the catastrophe of 1933, when Ukraine was a republic of the Soviet Union, and more than three million of its inhabitants starved when Stalin decided to blame the Ukrainian people for the failures of his own policy of collective agriculture. Intermingled with these recollections are memories of the German invasion only eight years later, which brought a second starvation campaign alongside the better known crimes of the Holocaust. In a world where food was a scarce resource, both Stalin and Hitler were obsessed with the Ukrainian “breadbasket,” and millions of Ukrainians died as a result.

About eight decades after the famine of 1933, and two decades after the end of the USSR, the strategic resource that binds Ukraine to both Moscow and Berlin is not food but natural gas. Ukraine’s major source of geopolitical significance is the Soviet-era pipelines that transport natural gas from Siberia to Europe. The terms of the gas trade are a major issue in Russian-Ukrainian relations, and the possibilities for profit a magnet for Ukraine’s post-Soviet oligarchs. Julia Tymoshenko, the best-known Ukrainian politician, made her fortune in the gas trade before making her name by cleaning out some of its corruption. As prime minister after the democratic Orange Revolution, she signed a deal with the Kremlin in early 2009 that governs the price and flow of gas from Russia. Now, in a case overseen by her arch-rival, current president Viktor Yanukovych, Tymoshenko has been convicted of “abuse of power” for making this deal—a judgment that has landed her seven years in prison.

Before Tymoshenko’s 2009 gas deal, Russia had cut off all gas supplies to Ukraine, and thus to countries west of Ukraine as well. Tymoshenko and Russian Prime Minister Vladimir Putin came to an agreement that seemed to resolve a tangle of competing claims about theft of gas and non-payment of debts. At that time, Yanukovych was in the political wilderness, having lost the presidential elections in 2005 after Tymoshenko and others protested electoral fraud committed on his behalf. One of his closest advisors, the energy trader Dmytro Firtash, was widely seen as Tymoshenko’s greatest personal rival. Perhaps not coincidentally, the agreement Tymoshenko signed with Putin ended Firtash’s company’s monopoly on the transit of gas through Ukraine. Now, with Tymoshenko in prison and Yanukovych in power, Firtash seems to be in a much stronger position.

The imprisonment of Tymoshenko has attracted the world’s attention, but it is only the latest outrage of the Yanukovych regime. The basic problem in Ukraine, and the one Yanukovych promised to solve in his 2010 electoral campaign, is corruption. Thus far he has delivered the opposite. He has worked to undermine the separation of powers, which has functioned reasonably well since Ukraine gained its independence in 1991. He has delayed elections when it seemed that candidates from his Party of Regions might lose. He uses the tax bureau and the tax police to harry opponents. A former minister of the interior has been held in jail for ten months without being charged. And the president has consolidated control of Ukrainian industry and pipelines in the hands of the rich men from the Donetsk region who support him.

Earlier this fall, Ukraine was about to sign an Association Agreement that would have opened EU markets to Ukrainian exports, a symbolic step in the direction of EU membership. Now European integration is looking much less likely. After Tymoshenko was convicted, Yanukovych was disinvited from a planned visit to Brussels (he went to Havana instead, to promote economic relations with Cuba). Most leading EU politicians are probably happy to have a reason not to have to trouble with Ukraine, given their own current problems. But even the few top-tier European leaders who support Ukraine’s integration into the EU—such as Carl Bildt of Sweden and Radek Sikorski of Poland— have now been offended. And in late October, Poland, Hungary, and the Czech Republic, the eastern member states with a strategic interest in admitting Ukraine, issued a statement to the effect that they cannot envision an Association Agreement in the current situation.

Nor has the Tymoshenko case helped relations with Russia. The most superficial western analyses associate Ukrainian authoritarianism with the pro-Russian sympathies of Ukrainian leaders, but the picture is much more complex. It is true that during the Orange Revolution Russia supported Yanukovych and opposed Tymoshenko. But it is far from clear that Putin now has the same preferences. After all, the trade arrangement just deemed criminal in a Ukrainian court is one Putin negotiated himself. Does the Yanukovych regime believe that it can now renegotiate that deal? If so it is hard to know what they think they have to bargain with. Early in his term Yanukovych conceded pretty much everything Moscow has said that it wanted from Ukraine, above all naval basing rights at Sevastopol for the next quarter century. What Russia will want next is something that Yanukovych cannot concede: control over Ukrainian industry and natural gas pipelines—the very assets that have made Yanukovych’s own crucial supporters the very rich men that they are.

This is why the diplomatic pose Yanukovych adopts is so transparent to the parties directly concerned. He threatens the Russians that Ukraine will join the European Union, but makes that impossible by imprisoning Tymoshenko. He threatens the Europeans with a rapprochement with Russia, although by now everyone in Brussels with any interest in Ukrainian affairs knows that his backers cannot really allow this. Ukraine’s foreign policy is thus a double bluff, and the true danger is that its architect does not grasp the implications of this, and will find himself very soon with no options. Meanwhile, the vast majority of Ukrainians—including most of Yanukovych’s own key backers— wish for their country to join the European Union.

Ukraine has long been a borderland between greater powers. What is different about the present moment is that it is now an independent state, and that it has become a borderland between two authentically different approaches to foreign relations. The European Union has no interest in admitting Ukraine as it is today, but might be interested in admitting the orderly, lawful eastern neighbor it might one day become. Russia has no interest in the rule of law in Ukraine, but is happy to exert influence upon its territory as part of its efforts to control the distribution of natural resources and reassert its power in the post-Soviet space.

It is possible that Yanukovych really does not understand that the European Union cares about law rather than about territory; he may therefore find himself, simply as a matter of weakness, falling under the sway of a Russia that, unlike the EU, does reason in traditional geopolitical categories. This would be the perfectly natural outcome of Yanukovych’s understanding all politics in personal terms—as matters of rivalry over wealth, and then revenge. But statehood must be, at some point, a willing acceptance of principles. Contrary to what Yanukovych seems to think, freeing Tymoshenko would matter not because the West likes her and doesn’t like him. It would matter because it would show that Ukraine could become a state governed by law, which is what Ukrainians themselves need more than anything else.