One big difference sets Sunday's presidential election in Ukraine apart from others held over the past 10 years to pick national leaders in the 12 countries of the former Soviet Union: Sunday's winner is not known in advance.

Last month, in the first round of balloting, former prime minister Viktor Yushchenko (the reformist leader of the opposition) and incumbent Prime Minister Viktor Yanukovych (the chosen successor of outgoing President Leonid Kuchma) each got slightly more than 39 percent of the votes, according to the official count. Yet, no matter who wins the runoff, what is happening in Ukraine has already demolished its image as a not-quite-European backwater. Although it is one of the most divided of all post-Soviet countries, Ukraine seems about to become, of all things, a democracy.

How did this happen? It's not that the place has adopted the rule of law. To the usual outrages -- such as state television's near-exclusive focus on one candidate, or huge and corrupt favors for the government's financial backers -- the campaign to date has added new touches that are bizarre even by Ukrainian standards. There is the still unexplained "poisoning" of Yushchenko, which kept him off the campaign trail for weeks; the mass influx of Russian celebrities, from pop stars to Vladimir Putin himself, all barnstorming for Yanukovych; and -- most worrisome for Sunday's runoff -- widespread tampering with voter lists on the day of the first round.

Nor has Ukraine overcome the divisions that made it one of the most vulnerable of the countries created when the Soviet Union collapsed in 1991. It has, of course, faced extreme poverty, crime and corruption, but it has also had to deal with the far more emotional issue of national identity. Some experts, viewing Ukraine's western regions as a cultural, linguistic and religious extension of Poland, and its eastern regions as a similar extension of Russia, wondered whether it was really a country at all.

Thirteen years later these divisions still weaken Ukrainian unity. According to the respected Razumkov Center in Kiev, 81 percent of western Ukrainians would again vote for Ukrainian independence. But in the east and south this number drops to one-third, and the central region is split down the middle.

The result is truly breathtaking political polarization. In last month's first round, two-thirds of Ukraine's 27 regions preferred one of the two finalists to the other by a margin exceeding 3 to 1. Yushchenko, strongest in western Ukraine, won 10 of these lopsided contests; Yanukovych, an easterner, won eight. In five regions, the gap was more than 10 to 1 -- and in some places it approached 30 to 1.

Yet Ukraine's very dividedness has turned out to be a crucial ingredient of its emergent democratic success. To be sure, after every election (no matter who wins) a large portion of the public feels deeply estranged from its leaders. That may be bad for national identity and civic consciousness, but it has so far been good for democracy. In Ukraine, merely winning an election doesn't enable you to put your opponents out of business -- something that, across the former Soviet Union, incumbents have had no trouble doing. The country's divisions give losers a political base that can't be taken away.

National disunity guarantees contested elections in practice, but poll results suggest that Ukrainians have gone further, embracing pluralism as a principle. The Razumkov Center finds that, while only 46 percent of Ukrainians nationwide believe that the country needs a multiparty political system, the idea enjoys majority support in both the east and the west -- that is, in those parts of the country that have the most to lose if every election comes out the same way. Putin explicitly made this link between regional animosities and political activism in trying to get out the vote for Yanukovych. You have to "make your choice," he warned, "or someone else will make it for you."

Ukraine is sometimes treated as a "halfway" country of Eastern Europe -- less burdened by Soviet legacies than Russia, but not able to throw off the past as easily as countries that were never part of the U.S.S.R. There is much truth in this description, but it is wrong about one thing: popular attitudes. Perhaps because they are so divided, Ukrainians actually have more democratic views than almost any other post-communist country.

When pollsters from Pew Research Center's 2003 Global Attitudes Project asked people in Ukraine, Poland, Bulgaria and Russia their view of a series of democratic norms, they found that Ukrainians came in first in their support for fair elections, a fair judiciary, freedom of the press and free speech.

Of course, these views, however strongly held, may not be enough to deter those who are out to steal Sunday's election. Nevertheless, they are a reminder that democracy can emerge by very different routes. For most rich and stable countries, it reflects institutions and values that have evolved over generations. In other circumstances, democracy can be the product of conflict as much as of consensus -- a practical tool that even poor and divided countries can use to solve their problems. For Ukraine, more than most, that connection has been easy to make.

A Russian journalist reflected recently on what Ukraine has achieved and, implicitly, what his own country has not. "I envy Ukrainians," he wrote. "They have a chance for normal democratic development."

The writer is a senior fellow at the Council on Foreign Relations and a professor of international diplomacy at Columbia University. He was U.S. ambassador at large for the former Soviet Union from 1997 to 2001.