Perhaps the biggest foreign policy challenge that has faced Ukraine’s leadership since the country regained independence in 1991 has been finding a balance between its relations with Russia and its relations with the West.

Over the past 20 years, each Ukrainian president has sought strong ties with Europe and the United States, in part to gain freedom of maneuver vis-à-vis a large and assertive Russian neighbor that appears not yet fully reconciled to the idea of Ukraine as a truly sovereign and independent state.

This challenge now confronts President Victor Yanukovych. He has stressed the utility for Ukraine of an association agreement and comprehensive free trade arrangement with the European Union, which would give Kyiv a solid anchor to Europe. But he is learning—as did his predecessors—that democratic values matter in the West, and they influence how the West engages with Ukraine.

Relations between Ukraine and Russia have a long, complex and sometimes unhappy history. As Kyiv in the early 1990s struggled to build an independent nation, Presidents Leonid Kravchuk and Leonid Kuchma placed priority on building relationships with the West in order to strengthen their hands as they dealt with Moscow on a range of messy post-Soviet “divorce” questions. Building those relationships was made easier, or more difficult, by the state of democracy within Ukraine. For example, democratic slippage during and after the 1999 presidential election contributed to the downturn that brought Ukraine’s relations with the United States and Europe to a nadir in late 2002.

Following the Orange Revolution, Victor Yushchenko’s foreign policy put dramatically more weight on the Western side of the balance, including by making a bid for membership in NATO. That helped to trigger a precipitous decline in Ukrainian-Russian relations. The more democratic, if often chaotic, nature of Yushchenko’s policies at home earned him considerable credit in the West, even if some Europeans worried about the problems that Yushchenko’s policy created between Kyiv and Moscow—and potentially between Europe and Russia.

Following his election in 2010, Yanukovych stated his desire for a balance between the West and Russia while making an improvement in the frayed relationship with Moscow his first foreign policy priority. He extended the Black Sea Fleet’s presence in Crimea, halted pursuit of NATO membership, and dropped policies that had infuriated the Russian leadership, such as seeking to have the Holodomor recognized as genocide.

Over the past year, however, Kyiv has grown increasingly frustrated by what it regards as Moscow’s failure to reciprocate Ukraine’s steps to improve bilateral relations. In 2012, Vladimir Putin will return to the Russian presidency, and he has just unveiled his “big idea” of a Eurasian Union. Yanukovych should understand that the better his relationship with Europe and the more stable the balance between his relationships with the West and Russia, the stronger his position will be in dealing with the Kremlin.

He needs also to understand that democracy affects the balance. The fact that Yanukovych’s election was free, fair and competitive gave him democratic legitimacy, which secured him acceptance and access in the United States and Europe. But his domestic policies since then have produced regression: pressure on the media, inappropriate actions by state agencies such as the Security Service of Ukraine, elections that failed to meet the standards of the Organization for Security and Cooperation in Europe or the norms that Ukraine achieved in 2006-2010, and arrests of opposition leaders on dubious charges. The trial of former Prime Minister Yuliya Tymoshenko has crystallized Western concern about Yanukovych’s democratic backslide.

Yanukovych must reconcile his desire to tighten political control, reduce the democratic space for the opposition, and keep Tymoshenko out of the political arena with his desire for closer relations with the European Union. He cannot pursue a more authoritarian course at home and at the same time enjoy strong relations with a West for whom democratic values matter.

A failure to secure a solid relationship with the West will cause disbalance in Ukraine’s foreign policy. That would leave Kyiv more isolated and susceptible to pressure from Moscow. Does Yanukovych want to risk dealing with Putin from a weaker international position? If not, then he needs to correct his domestic political course.