Afghan President Hamid Karzai finished his reelection bid Monday the same way he began it two months ago: shunning most trappings of traditional campaigning in favor of cutting a deal with a former warlord for support.
The endorsement of Karzai by Abdul Rashid Dostum, an Uzbek militia leader stained by allegations of massive human rights abuses, was the latest demonstration of the president's strategy for holding on to power.
But it further frayed his already strained relationship with the Obama administration, which wants an effective partner in waging war against the Taliban and building a viable Afghan state.
Karzai has been forced to make deals because of unexpected weakness in an election he had been expected to win easily.
Festering grievances about the president -- from the corruption that colors his government to the rising insecurity accompanying a revived Taliban insurgency -- have created a race that may deny him the majority of votes he needs for victory in the first round of balloting Thursday.
On Monday, as his rivals wrapped up their own campaigns, shouts of "Karzai! Kar-ZAI!" rang across a dilapidated soccer stadium in Kabul, a former Taliban execution grounds.
But the chants were not a sign of adoration for the beleaguered president. They were the answer to the question asked at a rally held by his principal rival, Abdullah Abdullah, demanding to know: "Who's the one who failed at governing?"
Even if Karzai manages to stay in office, his deal-making has become a source of alarm to the foreign partners who were once among his strongest backers.
Rather than crisscrossing the country in search of votes as his opponents have done, Karzai's campaign has relied on Afghanistan's version of machine politics: forging ethnic and political alliances largely based on patronage.
Karzai's testy relations with Western diplomats and military leaders dipped to a new nadir Sunday when he disregarded their pleas and allowed Dostum to return to Afghanistan from a year in exile.
Karzai has reached out to former warlords and regional power brokers since the beginning of the campaign -- he picked former warlord Mohammed Fahim as his running mate.
But nothing was as audacious as his move to bring Dostum into his tent during the election season's final hours. The Uzbek chieftain had been living in Turkey, where he had fled after attacking a rival at his home.
By Monday he was back in the northern Afghan city of Shiberghan, imploring his enthusiastic followers to vote for Karzai.
Dostum is believed to be capable of delivering a considerable chunk of support, and his return was read as an explicit bit of deal-making under which the warlord could demand a senior government post, or merely free rein in his own fiefdom.
The U.S. Embassy issued an unusually sharply worded rebuke, citing "serious concerns" over Dostum's presence, "particularly during these historic elections." Many observers fear that "forward-looking forces," as the top U.N. representative in the country, Kai Eide, put it, could be shut out of the new order if Karzai wins another term.
A visibly contentious relationship with the Americans, though, is likely to help rather than hurt Karzai's chances with voters. For much of his tenure, which roughly overlapped that of the Bush administration, he was seen by many Afghans as too willing to do Washington's bidding.
In recent months, kept at arm's length by the Obama administration, he has unleashed harsh criticism of the foreign forces in Afghanistan, saying their carelessness results in far too many civilian deaths.
Obama, in a speech Monday to more than 5,500 military veterans in Phoenix, called the dismantling of Al Qaeda in Afghanistan "fundamental to the defense of our people."
Once the darling of the West and a beacon of hope for his people, Karzai led the interim government set up after the Taliban movement was driven from power in the 2001 U.S.-led invasion. He had no serious challengers in Afghanistan's first direct presidential vote in 2004.
The world welcomed Karzai's win. In one capital after another, he was feted as a man who seemed to effortlessly straddle two worlds: charming and cultivated, educated and English-speaking, but with a deep connection to the Pashtun tribal culture from which he sprang.
Now Karzai's relations with the international community are frayed and many Afghans who voted for him the first time around have declared their intention to change sides.
On the last day of campaigning, the Karzai and Abdullah camps were again a study in contrasts.
Abdullah, who once served as Karzai's foreign minister, began the morning with the stadium rally in Kabul, the capital. He then flew off for a last round of barnstorming, this time in a troubled eastern province.
Karzai spent much of the day, as he often does, sequestered in the presidential palace. Through weeks of the campaign, he appeared at only a handful of rallies, usually highly orchestrated affairs packed with handpicked supporters.
The biggest problem for Karzai, though, is that he seems unable to articulate a larger vision for the country or even to explain why he wants another term.
Questions about why he is running often solicit a rambling reply centered on what clearly were his glory days: his daring and dangerous return to the southern city of Kandahar when it was still under Taliban control.
Abdullah, meanwhile, has been capitalizing on a crisply articulated call for change.
"Give me the power and I will give it back to you!" he told the stadium crowd Monday, which roared its approval.
"Our country is in a lot of trouble -- so much trouble! -- and he is not helping," a 50-year-old woman named Duljan said of Karzai. She has switched her allegiance to Abdullah.
Karzai's rallies have been more subdued, at times almost lifeless. At a gathering last week in the capital, the invited crowd of women was heavy on teachers and government employees, many of whom said they had been instructed by their bosses to attend. As soon as Karzai finished speaking, people rushed for the exits.
"Wait!" an organizer shouted fruitlessly. "Wait! The event isn't over yet!"
A poll released last week by the International Republican Institute showed gains for the president but also for his main challengers. Karzai's support was put at 44%, compared with 26% for Abdullah, 10% for populist lawmaker Ramazan Bashardost and 6% for former World Bank economist Ashraf Ghani.
The survey was based on interviews conducted in July, so if Karzai's rivals have made further gains or even just held their own in the intervening weeks, they would be in a position to deprive him of the majority he needs for victory Thursday. A final result may not be clear for weeks.
One of Karzai's biggest advantages going into the vote may also prove a pitfall. His fellow Pashtuns are the largest ethnic bloc in Afghanistan, and overwhelming support from them, which he is believed to still enjoy, would normally translate into victory.
But the most violence-ridden parts of the country, the south and east, are the Pashtun heartland, and observers fear that many people in those areas will be unable or unwilling to cast ballots because of a campaign of intimidation by the Taliban.
In recent days, that has included threats by local commanders in Kandahar and Helmand provinces to cut off voters' fingers, which are ink-stained after voting as proof they cast ballots.
Underscoring the rising violence that has coincided with the campaign, an American soldier was killed Monday in Helmand, where U.S. Marines and British troops have been battling the Taliban.
July was the bloodiest month for U.S. forces since the start of the conflict in 2001. August's troop casualty figures look on track to exceed that.