SIX YEARS AGO the dictator of a large Muslim country was overthrown, touching off days of looting and chaos in the capital. The new regime's promise of democracy was greeted skeptically: Many expected that ethnic divisions would tear the country apart, that Muslim parties would take power and try to impose Islamic rule, or that another strongman would soon take the place of the ousted ruler. But Indonesia has proved the pessimists wrong. This week it successfully staged its third elections of the year; 120 million of its people cast ballots, a turnout of 80 percent. The result was the direct election of a new president who promises to continue the consolidation of freedom in the world's fourth most populous country.

The president-elect, Susilo Bambang Yudhoyono, is a 55-year-old former general who previously served as security minister and has twice attended military training programs in the United States. He is also a moderate who portrays himself as a proponent of secular civilian rule and cautious reform. Those qualifications suggest he could be the first Indonesian president since the overthrow of the dictator Suharto to offer capable and consistent leadership. The first democratic president was impeached for incompetence, while the second, Megawati Sukarnoputri, initially enjoyed popularity as the daughter of a former populist president but lacked a clear agenda. Mr. Yudhoyono, who easily defeated Ms. Megawati in Monday's election, reportedly plans to begin with an anti-corruption campaign, attacking one of the worst problems threatening the new democracy.

The new system remains fragile and troubled. Ethnic conflict still rages in parts of the sprawling archipelago, and the military continues to be accused of violations of human rights. Though the economy has stabilized, the explosive growth of the Suharto era has not resumed. There has been a flowering of free speech and culture, but just days before the election the respected editor of one of the country's leading magazines, Bambang Harymurti, was sentenced to a year in prison for allegedly libeling a powerful businessman. Terrorists linked to al Qaeda have carried out three major bombings in the past two years and pose an ongoing threat.

No one would argue that Indonesia's liberalization is either complete or irreversible. Yet the country's experience shows not only that a Muslim country can embrace democracy but that even a fledgling and flawed system can produce a working government that offers greater freedom to millions. The United States rightly has been supportive of Indonesia; as its new president takes office, the Bush administration should step up aid and other programs aimed at improving such democratic institutions as courts, free media and secular schools.

Skeptics of Muslim democracy, meanwhile, ought to take note: 120 million ballots say they are wrong.