Editor's note: Peter Bergen is a fellow at the New America Foundation, a Washington-based think tank that promotes innovative thought from across the ideological spectrum, and at New York University's Center on Law and Security. He's the author of "The Osama bin Laden I Know: An Oral History of al Qaeda's Leader."

(CNN) -- Afghan President Hamid Karzai travels to Washington this week to meet with President Obama and with his Pakistani counterpart Asif Zardari.

There will be much to discuss -- principally, of course, how to reverse the rising tide of Talibanization on both sides of the Afghan/Pakistan border, which is a key foreign policy challenge for the Obama administration.

But how long will Obama and Zardari have to deal with Karzai whose five-year presidential term expires this month and who is now up for election on August 20th?

The question is not a small one for the success or failure of what has become 'Obama's War' in Afghanistan. Karzai has long been derided as the 'mayor of Kabul' because his authority supposedly doesn't extend much beyond the capital. And his government is rightly seen as rife with corruption. The non-governmental organization Transparency International, for instance, rates Afghanistan, as one of the most corrupt countries in the world..

Despite these handicaps, Karzai is on track to win a landslide in this summer's election. Why? First, Karzai is a rather adept politician, something that his many Western critics don't often grasp. Consider the moves Karzai made around the time of the first presidential election in 2004:

-Karzai forced Ismail Khan, the powerful governor of the western province of Herat, to resign, giving him instead the consolation prize of the ministry of energy.

-Uzbek strongman Abdul Rashid Dostum was given a job with a fancy title but no power at the Ministry of Defense.

-And in July 2004, Karzai dropped Mohammad Fahim as his running mate for the presidency. Fahim, a power-hungry general who had awarded himself the title of field marshal after the fall of the Taliban, was later removed by Karzai from his post as minister of defense.

Don't Miss

With these moves, Karzai not only skillfully neutralized his most powerful rivals, men who could field their own private armies, but he also increased the authority of the central government.

Karzai aced the presidential election on October 9, 2004, winning 55 percent of the vote against more than a dozen other candidates in a reasonably fair contest -- a greater margin of victory than President Obama won in 2008 against his one serious challenger.

Karzai has again demonstrated his deft political skills for the upcoming election. Last month, the main opposition party, National Front, said that one of its founders, former minister of defense Fahim, had left the group to back the president. On Monday, Karzai named Fahim as one of his two running mates.

And after meeting Karzai on Friday, Gul Agha Sherzai, a powerful Pashtun governor who enjoys American support and who met with Obama when he was a presidential candidate, announced he was pulling out of the race.

So what opposition remains? Dr. Abdullah, the former foreign minister, may throw his hat in the ring. He is a very able public servant but he is far too identified with the Northern Alliance that overthrew the Taliban and is dominated by the Tajik minority.

Only a Pashtun candidate can realistically win an election in Afghanistan given the fact that Pashtuns are the largest ethnic group in the country.

Another candidate is likely to be Ashraf Ghani, the former finance mister, who is brilliant, but is hardly a grip-and-grin retail politician.

Zalmay Khalilzad, the former US Ambassador to Afghanistan, is a dark horse candidate who has given mixed signals about his willingness to run and has also been out Afghanistan for the past four years.

Then there are Karzai's own advantages as he goes into the election. He has enormous name recognition in a country where the population is largely illiterate and he has the advantage of incumbency in a race where other candidates will only have four months to organize.

Karzai remains somewhat popular. Yes, his favorable ratings in polls have dropped from 83 percent in 2005 to 52 percent today, but that puts him around where President Bush was polling on the eve of his successful reelection in 2004 when he had a 53 percent favorable rating.

And Karzai is a Pashtun from the Durrani tribal grouping which has supplied almost all of Afghanistan's rulers since the mid 18th century. His past successful electoral performance shows that he is also able to attract voters from other ethnic groups.

Karzai has skillfully put some distance between himself and the US on the issue of Afghan civilian casualties caused by American airstrikes, something that Afghans feel very strongly about.

Yet the Obama administration will roll out the red carpet for him upon his arrival Tuesday and Karzai will return to Afghanistan at the same time as the May 9 deadline for anyone who wants to register as a presidential candidate. The timing makes it seem as if he has the seal of American approval, whatever is said by US officials about "not backing any particular candidate."

The question then is what Karzai will do in his next five-year term.

One can only hope that with an electoral mandate he will takes strong measures against corrupt officials in his government, including these profiting from the drug trade. And that he will foster the emergence of Pashtun political parties to provide an outlet for Pashtun grievances, something he has seemed reluctant to do and that allows the Taliban to position themselves as the defender of Pashtun rights.

At the end of that five-year term Karzai will have led his country for more than a dozen years. If he makes the right moves he will remembered as 'the father of the nation.'

If he makes the wrong ones he will forever be tagged as "the mayor of Kabul."

The opinions expressed in this commentary are solely those of Peter Bergen.