VIKTOR YANUKOVYCH deserves no reward for his heavy-handed rule as president of Ukraine. His term has brought increasing corruption, a concentration of power in the presidency and show trials of political opponents. The most worrying has been the case of Yulia Tymoshenko, a former prime minister who now languishes in prison on a seven-year sentence.

Yet those concerned about Ukraine’s future have some reason for hope about a deal that will give Chevron and Royal Dutch Shell the rights to develop unconventional natural gas fields in the country. The arrangement could lead to $370 million in investment and result in Ukraine producing up to 10 percent of the gas it uses by 2020. If handled well, it could prove more impetus for good behavior than reward for bad.

True, the contract seems to undercut the West’s recent approach toward Ukraine, which involves rebuking Mr. Yanukovych’s regime following Ms. Tymoshenko’s sentencing. The European Union has put wide-ranging trade talks on hold, and there is talk of European leaders boycotting a soccer tournament in Kiev this summer. For now, relations between the Russian government and Mr. Yanukovych are also cool, which, combined with the lure of lucrative future economic ties, gives the West some leverage to push Ukraine back from authoritarianism. The E.U. is right to use that leverage.

What’s more, Anders Aslund, an expert on Eastern European economies, warns that Chevron and Shell’s natural gas projects could very easily become ensnared in official corruption, benefiting a small circle of oligarchs surrounding Mr. Yanukovych and producing little fuel.

Yet by the same token, the new gas deal provides Ukraine an opportunity to demonstrate that its government can insulate critical economic affairs from that corruption, letting Chevron and Shell conduct their work free from unnecessary hindrance. Bringing Western corporate efficiency into Ukraine’s energy sector would also help remove one of the largest long-term obstacles to the country’s westernization: Russia. Ukraine’s dependence on Russian natural gas has been the primary tool used by Russian President Vladimir Putin to manipulate Kiev. More freedom from Russia would enable Ukraine to chart its own course, including, potentially, liberalization that would allow deepening ties with the European Union. Much will depend on details of the relationship between the government and the companies yet to be spelled out.

In the meantime, the West must maintain its pressure on Mr. Yanukovych. Releasing Ms. Tymoshenko should be a minimum condition placed on talks to establish preferential trade arrangements with the E.U. And the West should pay close attention to parliamentary elections in October, urging the Ukrainian government to hold fair contests and monitoring the polls as best it can.

During two decades of independence, Ukraine has wavered between the authoritarian model to its east and the democratic model to the west. The United States, its allies and, above all, the Ukrainian people will be best served if Ukraine can escape the temptations of Putinism.