AFTER ENDURING Soviet occupation, civil war and rule by a medieval-minded Islamic militia, millions of Afghans lined up at polling stations yesterday for the first free election in their country's history. This was an extraordinary event, the more so because it happened in spite of concerted efforts by the Taliban militia and its al Qaeda allies to prevent it. Thanks in part to U.S., NATO and Afghan forces and in part to the remarkable determination of Afghan citizens to launch their democracy, the enemy campaign failed. The turnout percentage for the presidential vote may rival that of the U.S. presidential election.

Instead of terrorist attacks, a problem more typical of electoral democracies cropped up: Fifteen of the candidates running against the current president, Hamid Karzai, abruptly announced a boycott because of a mix-up at some polling stations about the type of ink used to mark voters' fingers. Their protest, which U.N. officials said would be considered, could cast a pall over the election's results. But as Mr. Karzai pointed out, his opponents' posturing didn't change the reality that millions of Afghans had braved harsh weather and the threat of violence to cast ballots for the first time.

Elections, of course, are never panaceas, and it would be wrong to overlook the many ways in which Afghanistan's political and economic reconstruction remains tenuous. Security is still a major problem in southern provinces, where 13 percent of the population lives. There and in the north, warlords have considerably more authority than the central government. The United States and other Western countries have been inexcusably slow to deploy peacekeeping troops around the country. Most threatening of all may be Afghanistan's booming opium production, which is fueling corruption and providing warlords, the Taliban and probably al Qaeda with a lucrative source of income.

Yet it also would be foolish to discount the advances Afghanistan has made in the past three years. Not only has most of the country enjoyed relative peace during that time, but per capita incomes have doubled, millions of children -- including most girls -- have returned to school, and infant mortality and other health measures have improved. Kabul and other cities are booming, a national road network is under construction and 3 million refugees have returned home. Mr. Karzai recently ousted two of the most powerful warlords from their governmental positions, and about a quarter of the militia members around the country have been demobilized.

Not surprisingly, polls show that Mr. Karzai is supported by most Afghans -- and so is the United States. In a poll sponsored by the Asia Foundation earlier this year, U.S. troops received a favorable rating from 67 percent of the population. A more recent survey by an Afghan human rights coalition showed that 75 percent of voters said they felt free to choose any can- didate in the elections, more than 90 percent said all women should vote and 85 percent believed the election will bring positive change to Afghanistan.

Opponents of the Bush administration both here and abroad often have been loath to acknowledge these positive facts. Sen. John F. Kerry frequently speaks of Afghanistan as if it were just another of Mr. Bush's foreign policy disasters. But Afghanistan's reconstruction should not be a partisan or diplomatic football. Instead U.S. and other Western leaders should be pointing out, to each other and to their publics, that nation-building there can work -- and that it is consequently worthwhile to continue committing troops and aid to the effort.