Defense Secretary Donald H. Rumsfeld, making a brief, unannounced visit here Wednesday, said he believes Afghanistan is "on the path to having successful, free and fair elections" in October and pledged continued U.S. and international support for that effort.

Rumsfeld described as "regrettable" the wave of attacks by Islamic militant groups in which a dozen voter registration workers have been killed. He emphasized the unexpectedly high level of voter registration, which recently passed the 9 million mark in a country with an estimated 9.5 million eligible voters.

"Given the campaign of intimidation and attempts to dissuade people from registering, the surge in registration has to be a very vivid demonstration that the Afghan people are determined to make democracy work," Rumsfeld told reporters during a joint appearance with Afghan President Hamid Karzai.

But Rumsfeld suggested that drug trafficking could present a far more serious threat to political stability and freedom in Afghanistan, the world's largest producer of opium poppies.

"The danger that a large drug trade poses to Afghanistan is too serious to be ignored," Rumsfeld said, adding that once large sums of money from the drug trade filter into a country's economic and political system, "the inevitable result is to corrupt governments and the way of life."

Rumsfeld noted that Britain has taken the lead in assisting the Karzai government's efforts to combat drugs, but he told reporters aboard his plane Tuesday that the Bush administration was developing a "master plan" to help curb opium poppy cultivation and trade here. He did not provide any details.

Despite Rumsfeld's upbeat assessment of Afghanistan's political progress, his visit came as the country's presidential campaign has taken some unexpected and potentially alarming turns. On Tuesday, the election management commission announced the final list of 23 approved candidates, including Gen. Abdurrashid Dostum, a powerful regional militia leader who still commands thousands of troops and has been widely accused of human rights abuses.

Election rules barred anyone involved in human rights violations or associated with a private army from running for office, but commission members said they had reached an agreement with several candidates tied to militias, including Dostum, that would allow them to remain on the ballot as long as they replaced any objectionable subordinates with national army officers.

Karzai has said that abuses and potential election manipulation from autonomous militia leaders and their lower-level commanders, known here collectively as warlords, pose a greater threat to the elections than attacks by the Taliban or other Muslim militant groups.

At the news conference Wednesday, however, he said he could not comment on the decision of the election commission, "an independent body. . . . It's their decision and we respect it."

Another recent development that has raised concerns was the abrupt move by Karzai to drop Vice President Mohammed Fahim as his running mate. Fahim, who is also the Afghan defense minister, controls a militia and a large arsenal. He promptly disavowed Karzai and announced his support for the last-minute candidacy of Education Minister Yonus Qanooni, a former militia ally.

Rumsfeld held a private, 20-minute meeting with Fahim on Wednesday at the Defense Ministry. He said at the news conference that they had discussed the progress of militia disarmament, drug problems, military reforms and the development of the new national army.

The report on voter registration, meanwhile, has been tainted by allegations that many voters have filled out two or more registration cards in different districts. In some areas, the number of registered voters has surpassed the estimated number of voting-age inhabitants.

But Karzai, speaking at Rumsfeld's side in a grove of ancient chestnut trees outside the presidential palace, appeared unfazed by the charges.

"People are enthusiastic, and they want to have cards. It doesn't bother me," Karzai said with a smile. "If they want to vote twice, they're welcome." A moment later, though, he pointed out more soberly that no one can actually vote more than once in the election, scheduled for Oct. 9, because each voter's finger will be stained with ink.

There also have been concerns raised by U.N. officials and others that drug money could influence the outcome. Opium poppy cultivation is at an all-time high in the country. In several poppy-growing provinces, police officials, militia commanders and other regional authorities have been accused of involvement in the drug trade.

Rumsfeld this week has signaled a new urgency in Washington about the interplay between political stability and drug trafficking in Afghanistan. "It is increasingly clear to the international community that to address the drug problem here is important . . . for the people of Afghanistan" as well as for victims of drug abuse abroad, he said Wednesday in the eastern city of Jalalabad.

Defense Secretary Donald H. Rumsfeld, at a news conference in Kabul with Afghan President Hamid Karzai, said drug trafficking is a serious threat to political stability in Afghanistan.