Hamid Karzai got what he wanted - a mandate from the people. But he knows legitimacy depends as much, if not more, on what happens next.
Karzai promised a new team "Afghans would be happy with"
Afghans were also voting for change. In an interview in Kabul before election day, Mr Karzai acknowledged these expectations.
Victory, he vowed, would give him a mandate to create a government "very different" from his teams of the past three years.
The man handpicked for office through the 2001 Bonn Agreement now seemed more assured, less vulnerable.
He needed this election to strengthen his political hand, but his margin of victory - he won 55.4% of the vote - was less than his supporters had hoped for. And voting largely followed ethnic lines.
Mr Karzai, a Pashtun, dominated in his tribe's southern heartland and drew some support from other regions, including major cities. But some of his challengers won large blocks in their ethnic strongholds.
Mr Karzai's new catchphrase is "national participation".
Disentangling drug lords from the cabinet and Mr Karzai's team of advisers and provincial governors will be difficult, if not dangerous
The president and his advisers insist they are not obliged to give posts to defeated presidential candidates like the powerful commander General Abdul Rashid Dostum, who prevailed in Uzbek and Turkmen areas, and Mohammed Mohaqiq, who polled most votes among Hazaras.
"We will ask them to recommend qualified people from their communities," said one minister in an interview before the elections.
Advisers acknowledge the need for political appointments but emphasise they must also bring in Afghans capable of running ministries. The challenge will be to find capable professionals who also carry political weight within their ethnic groups.
The election has only reinforced this highly sensitive divide.
Mr Karzai knows many Afghans expect to see fewer military commanders, known as warlords. But he made it clear he would not wipe the slate clean.
"There are nasty pieces and good pieces," he insisted in one interview. His dichotomy will soon be tested.
Afghans expect fewer warlords in power like General Dostum
There will also be controversial discussions about which "moderates" from the Taleban movement should be allowed to return to Kabul.
Another clear message emerged from every conversation in Kabul about the new cabinet. It would have to send a strong signal that Afghanistan was confronting its major narcotics problem.
"I won't be part of efforts to build a narco state," declared one senior minister expected to remain in the government.
But disentangling drug lords from the cabinet and Mr Karzai's team of advisers and provincial governors will be difficult, if not dangerous.
Intelligence sources say there is clear evidence of involvement all through the system in this highly lucrative business which has again turned Afghanistan into the world's largest producer of opium poppies.
Mr Karzai vowed to "fight like hell" on this front. The next bold step would be to put at least one senior figure on trial for drug trafficking, as well as corruption, which is perceived to be widespread and growing.
Hard decisions must also be taken on what to do with documentation provided by the Afghanistan Justice Project about the past quarter century of war and individuals allegedly involved in war crimes who still occupy influential positions.
Karzai has boldly sidelined General Fahim (L) and Ismail Khan
Mr Karzai's recent success in boldly sidelining powerful figures such as his defence minister, General Mohammed Fahim, and the former governor of Herat, Ismail Khan, has clearly boosted his confidence.
For a president whose own army is still being trained, the risky moves were only possible with the backing of the international community.
When Mr Karzai came under pressure not to take General Fahim as his election running mate, a clear signal from the Pentagon and a telephone call from British Prime Minister Tony Blair stiffened his resolve.
Washington's earlier reluctance to move against commanders who were also playing key roles in its "war on terror" has clearly shifted. "The sun is now setting on warlords," was the way one American general in Kabul put it.
Afghan sources and diplomats believe that in the past, Mr Karzai often underplayed his hand and gave concessions - a result of his political and military weakness and a temperament that prefers conciliation to confrontation. The Karzai approach was to "bring everyone into the tent".
The big tent seems to be slowly coming down, although Mr Karzai wants to avoid it collapsing in a heap.
Mr Karzai, like many others, was moved by the determination of Afghans to vote despite security threats and political pressures.
He has cautioned that real change will take time, but promised a new team "Afghans would be happy with".