KABUL, Afghanistan — With a nationwide election only weeks away, the paradox of President Hamid Karzai has never seemed more apparent: he is at once deeply unpopular and likely to win.
Mr. Karzai, who has led Afghanistan since the fall of the Taliban in 2001, is blamed by many for the failures that have plagued the American-led mission here in the past eight years, from the resurgence of the Taliban to the explosion of the poppy trade.
Yet at the same time, Mr. Karzai enjoys a commanding lead in the race for the presidency, to be decided in a nationwide election on Aug. 20. Since the beginning of the year, Mr. Karzai has deftly outmaneuvered a once formidable array of opponents, either securing their backing or relegating them to the status of long shots.
Those two facts — Mr. Karzai’s unpopularity and the likelihood of his victory — have cast a pall of resignation over the presidential campaign here, with many Afghans preparing themselves for another five years of a leader they feel they already know too well.
The danger, Mr. Karzai’s opponents and other leading Afghans say, is a kind of national demoralization, which will discourage Afghans from voting and dash hopes for substantial progress once the election is over.
For the Americans, the prospect of Mr. Karzai’s re-election risks an even closer association with an unpopular president with a record of mismanagement. With the Taliban now stronger than ever — early this month, attacks reached their highest level since 2001 — a Karzai victory could threaten the American-led push to turn the war around.
“Karzai will not change, he has demonstrated that,” said Ashraf Ghani, once a close friend of Mr. Karzai, who is now running against him. “If he wins, there will be a downward spiral.”
American officials, who have provided indispensable support for Mr. Karzai since he first took office in 2001, have recently tried to put him at some distance. The new American ambassador, Karl W. Eikenberry, took the unusual step last week of attending news conferences of the leading challengers to Mr. Karzai, including Mr. Ghani and Dr. Abdullah, a former foreign minister, who like many Afghans uses only one name.
The Obama administration has reversed the previous American policy of nearly unconditional support for Mr. Karzai. President Obama has publicly chastised Mr. Karzai for his government’s weakness and corruption.
Yet there is a widespread perception among Afghans that Mr. Karzai is the American favorite. Some American officials express resignation that they may be stuck with him for five more years.
Indeed, the Obama administration appears to have begun preparing for that prospect. American officials, for instance, have done nothing to oppose the discussions between Mr. Karzai and Zalmay Khalilzad, the former American ambassador here, about Mr. Khalilzad’s becoming a senior official in a new Karzai administration.
“The Americans need to do more to distance themselves,” Dr. Abdullah said. “Otherwise, they will be blamed for the failures of his government by their own public as well as by ours.”
No one expressed more surprise about the perception of American favoritism than Mr. Karzai himself. Asked about it at a recent news conference, he curtly replied, “I’m glad to see this change of heart.”
It is hardly surprising that Mr. Karzai’s popularity is slumping. He has been in power for eight years, and in that period hopes for a stable and prosperous Afghanistan have been frustrated.
Mr. Karzai’s unpopularity was spelled out in a recent poll conducted by the International Republican Institute, a nonpartisan group supported by the American government.
Only 31 percent of Afghans said they would vote for Mr. Karzai again, down sharply from the 54 percent of votes he received in the 2004 election. If no candidate surpasses 50 percent of the vote, the two top vote-getters would face each other in a runoff election.
Yet the same I.R.I. survey found Mr. Karzai easily outpolling his rivals. Only 7 percent favored Dr. Abdullah and just 2 percent Mr. Ghani, and they are considered to be Mr. Karzai’s most serious rivals.
It was not always so. Only months ago, Mr. Karzai was considered vulnerable, and his rivals were lining up to take his place.
But showing a deftness that has often eluded him in governing, Mr. Karzai systematically co-opted most of the Afghans who were considering running against him.
In neutralizing his opposition, Mr. Karzai has aggressively wielded the power of his office. With all the resources of government at his disposal, Mr. Karzai can dispatch his employees to work on his re-election, and he can use government resources, like helicopters and airplanes, to crisscross the country. No other candidate can match that.
Nor has Mr. Karzai been shy about making deals with unsavory characters, including militia commanders with reputations for brutality and corruption.
The horse-trading has infuriated his opponents, who accuse him of putting the Afghan government up for sale to the worst sort of people. “He is auctioning off the government,” Mr. Ghani said.
This month, for instance, Mr. Karzai reinstated as chief of staff of the army Abdul Rashid Dostum, who was suspended last year after he was accused of storming the house of a political rival and threatening him at gunpoint.
Mr. Dostum, a former militia commander, has perhaps the most brutal reputation of any warlord, having fought for virtually every side over the past 30 years.
In a similar way, Mr. Karzai last month named Muhammad Qasim Fahim as one of his two vice presidential running mates. Mr. Fahim is a former commander of the Northern Alliance, the rebel group that toppled the Taliban in 2001. He has a spotted past; among other things, he is suspected of printing millions of dollars worth of Afghan currency for himself in the early days of the first post-Taliban government.
Finally, Mr. Karzai appears to have made a brazenly explicit promise to Muhammad Mohaqeq, the leader of a large ethnic party and a former militia commander. In an interview, Mr. Mohaqeq said that Mr. Karzai had promised his group, the Islamic National Unity Party, five seats in his cabinet in exchange for his support.
“People are tired, yes, but they have not lost their nerve,” Mr. Mohaqeq said. “There is no alternative to Karzai.”
At a recent public appearance, Mr. Karzai was looking his typically regal self, sporting his trademark karakul hat and cape. Asked about his deals with the warlords, he was unapologetic.
Choosing Mr. Fahim as a running mate, Mr. Karzai said, “was a decision that I made for the good of the country, for the unity of the country, for the strength of Afghanistan, in which it has a government that is Afghan and not influenced from outside.”
He did not elaborate on whose outside influence he was concerned about.