US Defence Secretary Donald Rumsfeld says the enthusiasm of the Afghan people for elections shows they are determined to make democracy work.
Rumsfeld (left) and Karzai at a Kabul news conference
Mr Rumsfeld, on a one-day trip to the country, said in Kabul that the Afghan people were winning their battle to rebuild the nation.
He appeared alongside President Hamid Karzai, who will contest the presidency on 9 October with 17 other candidates.
The elections have twice been delayed because of growing security fears.
"This upcoming election is an important one," Mr Rumsfeld said in an upbeat address to journalists in the Afghan capital.
He said that election officials had told him that more than nine million people had now registered to vote, with women making up more than 40% of that figure.
Problems with registration, combined with violence blamed on the Taleban in many parts of the country, have contributed to the rescheduling of both the presidential and parliamentary elections.
"The surge in registration that's taken place throughout the country has to be a very vivid demonstration of the Afghan people's determination to make democracy work," Mr Rumsfeld argued.
Standing next to him, President Karzai sought to allay concerns over possible multiple registrations.
He assured reporters an ink stain on voters' fingers would mean no one could vote twice, but there was confusion when he at first tried to make light of the issue.
Mr Rumsfeld also praised the progress made towards an Afghan national army and the attempts to unite the nation's disparate groups.
The defence secretary also touched on the drugs issue, saying: "It is very clear to the international community that the drug problem is serious. It is corrosive... it can effect the entire political process."
Earlier on Wednesday, Mr Rumsfeld had been to Jalalabad, a key poppy-growing region in Afghanistan.
He said before arriving in the country that a new plan on drugs was being worked on to deal with the problem but he would not go into details.
It is estimated that Afghanistan produces 75% of the world's illegal opium.
In Jalalabad, Mr Rumsfeld also met a US provincial reconstruction team - one of the small military groups deployed in the regions to try to encourage stability and humanitarian efforts.
He told US soldiers there: "This country's doing well. You folks are doing well."
Back in Kabul, Mr Rumsfeld also met Defence Minister Mohammad Fahim, who is backing one of Mr Karzai's rivals for the presidency.
The US has been careful not to give open backing to Mr Karzai, saying it would work with whoever was chosen by the Afghan people.
Afghanistan produces 75% of the world's illegal opium
Mr Rumsfeld is accompanied on his trip by America's most senior serving officer, the Chairman of the US Joint Chiefs of Staff, General Richard Myers.
They are meeting local US commanders and, according to US defence officials, there is a major review of US strategy underway.
One result of this visit, they say, is likely to be an acceleration of efforts to train and equip the Afghan army and security services.
Mr Rumsfeld said in his previous stop, Oman, that the US expected more attacks by the Taleban during the election period.
He said: "Is the Taleban still active in the neighbouring areas? Sure. That's just a fact. Are they going to end up being successful? No. They are going to end up losing."