The European Court of Human Rights ruled today on what was already obvious: that Ukraine's imprisonment of former Prime Minister Yulia Tymoshenko on abuse-of-office charges was politically motivated -- or at least unrelated to the accusations themselves.

The timing of the court's decision is inconvenient for Ukraine's government and for the European Union. Both want to declare that Ukraine has met its conditions for signing an Association Agreement, which has a May deadline.

An Association Agreement, a kind of halfway house to EU membership, would institutionalize the country's balancing act between the EU and Russia. One of the few things that unite Ukraine's politically divided east and west is a desire to sign the pact, which has a free-trade agreement attached. But among the European Council's conditions of the Association Agreement, set out in December, was that it expects Ukrainian authorities "to address the cases of politically motivated convictions without delay."

Reasons to sign the Association Agreement are only increasing with time, as Ukraine discovers shale gas deposits and prepares to exploit them. The agreement might enable the country to export its own gas to EU markets and allow Ukraine to reduce its energy dependence on Russia, from which it gets 60 percent of its natural gas. Russia, on the other hand, says it will cut the relatively high price Ukraine pays for gas if it joins a trade bloc with Russia, Belarus and Kazakhstan.

If Ukraine were to be rebuffed by the EU, then sign a customs union with Russian President Vladimir Putin's managed democracy and two ex-Soviet dictatorships, the path to EU integration would end. Europe would lose a market of 47 million people, Ukrainians would lose a more open future, and Moscow's dominance would once again reach to Poland's border.

These are high stakes, and Ukraine's government has not been shy to use the threat of turning east as it presses the EU into signing the Association Agreement, all while Tymoshenko remains in jail. The EU should ignore such pressure.

Ukrainian President Viktor Yanukovych is no more democratic or less appalling a political figure than he was in 2004, when he attempted to steal a presidential election in which his main opponent, former National Bank of Ukraine governor Viktor Yushchenko, was disfigured for life after ingesting poison. Tymoshenko, with her blond hair and faux-folk braid, was an iconic leader of the Orange Revolution that followed; when Yanukovych returned to power in 2010, he had Tymoshenko and some of her top ministers thrown in jail on trumped-up charges.

Earlier this month, Tymoshenko's former interior and environment ministers were pardoned in an apparent attempt to meet the conditions of the Association Agreement, but she was not. It isn't clear if Yanukovych can bring himself to release Tymoshenko, a powerful political opponent who has the potential to unseat him.

Tymoshenko is no angel. She made a fortune in Ukraine's deeply corrupt natural gas trade before becoming prime minister. And she was hardly a success in office. Still, the EU should stand firm. Yanukovych has taken dozens of steps to "Putinize" the country by concentrating power to create a Russian-style managed democracy. At this point, only the draw of the EU can reverse that.

As for the threat of jumping into Moscow's arms, Yanukovych won't do it. Ukraine's big businessmen fear nothing more than falling under Russia's sway. Yanukovych himself knows the price of allegiance to Putin would be high. And above all, the western half of the country would revolt.

Tymoshenko's false prosecution is a powerful symbol of what is wrong in Ukraine. That won't change if Yanukovych believes he can get what he wants from the EU while abusing the courts to dispose of his political opponents.

(Marc Champion is a member of Bloomberg View's editorial board. Follow him on Twitter.)