US President Barack Obama said the US-led forces must "focus on finishing the job" in Afghanistan after what he said appeared to have been a successful election in the country.
Millions of Afghans went to the polls on Thursday, defying Taliban threats of violence and sporadic attacks to choose a president in the midst of a worsening war.
"We had what appears to be a successful election in Afghanistan, despite the Taliban's efforts to disrupt it," Obama said from the White House. "We have to focus on finishing the job in Afghanistan but it is going to take some time."
The election was a test for Obama's new strategy aimed at reversing Taliban gains. US combat casualties have risen amid a US troop buildup and opinion polls have shown weakening American backing for the war.
Support for the Afghan campaign among some NATO allies is also on the wane and the German government scrambled to quash a public debate about pulling German troops out of Afghanistan that has grown louder amid the surge in violence.
The White House said Afghans had turned out to vote in large numbers despite threats of violence and US policy in the eight-year-old war would not change.
Preliminary results are not due for two weeks, although polling stations could begin to report sooner.
The Afghan government said nine civilians and 14 members of the security forces were killed in 135 incidents countrywide on polling day.
Pre-election polls showed Karzai, in power since 2001, was likely to win but not by enough to avoid a run-off against his main challenger, his former foreign minister Abdullah Abdullah, who ran a surprisingly energetic campaign.
If Karzai fails to win more than 50 percent of the vote he will face a run-off in October, most likely against Abdullah.
The election is in large measure a referendum on Karzai, a master coalition builder who is personally liked by most Afghans but also widely blamed for running a government that is corrupt, ineffective and entirely dependent on international aid.
The president relied for votes on the endorsements of many of the country's notorious former militia chiefs, raising alarm among his Western backers that the cost of a victory in the election could be a return of warlords to power.
Corruption back in focus
Experts say no matter who wins, the ultimate victor's approach and whether the election is deemed credible will have a big impact on the success or failure of US strategy.
"We are going to need an understanding from whoever the new president is that Afghanistan is going to rise to the occasion," said Bruce Riedel of the Brookings Institution think tank.
"We have now put roughly 70,000 American soldiers into this war, we are committing billions of dollars in new assistance. We are living up to our end of the deal to resource the war properly," added Riedel, who oversaw the Obama administration's policy review this year of Afghanistan/Pakistan policy.
There also needs to be concrete proof early on that a new government is serious about good governance, fighting corruption and embracing the rule of law, said Alex Thier of the US Institute of Peace nonpartisan think tank funded by the U.S. Congress.
"A failure to do that, particularly in Karzai's case, will lead to the further erosion of his legitimacy and also that of the government -- and by extension the international efforts in Afghanistan," Thier said.
US special envoy to Afghanistan and Pakistan Richard Holbrooke told reporters that after the vote count, for the United States corruption was "the most important issue".
Support among Washington's NATO allies for the Afghanistan mission is running thin. Debate about a pullout flared in Germany at the weekend after Volker Ruehe, defence minister under former Chancellor Helmut Kohl, called the Afghan mission a "disaster" and pressed Berlin to act.
Polls show a solid majority of Germans would like the 4,200 German troops operating in Afghanistan as part of a six-year-old NATO mission to return home.
The violence has prompted prominent political voices in Germany to press the government for a plan to pull out troops -- calls the chancellor and leading ministers dismissed.
"It is not helpful in a situation that is very difficult for German soldiers to question the purpose of the mission," Chancellor Angela Merkel told the Frankfurter Allgemeine Zeitung newspaper.