Hamid Karzai became the first popularly elected president of Afghanistan in 2004 - nearly three years after being appointed the country's interim leader. He was declared president for a second term on 2 November 2009 following elections dogged by controversy over vote fraud.
After taking up power in December 2001, Mr Karzai survived an early assassination attempt and infighting among ethnic groups to carve out a reputation as a shrewd statesman.
Hamid Karzai has long supported a broad-based government
But he faced a storm of criticism during the 2009 election. Initial results suggesting he had won outright were overturned by a UN-backed panel.
A second round run-off was cancelled after his main rival Abdullah Abdullah pulled out - leaving some people to question Mr Karzai's legitimacy and ability to govern effectively.
Although relations between Mr Karzai and his Western allies continue to be close, tensions have crept in over recent years.
His critics say he has had little control of events much beyond the capital, Kabul, where an insurgency by the Taliban and their allies is growing in strength. Ethnic warlords still hold sway in many parts of the country.
Billions of dollars of international aid have been poured into the country - and Mr Karzai's government says it needs billions more. His critics say much money has been lost because of widespread corruption.
Foreign donors want more done to stamp this out and co-ordinate relief efforts.
But allegations of corruption and fraud rose to a new level in the August 2009 election campaign and its aftermath, as international observers reported widespread ballot-stuffing and other irregularities.
Mr Karzai was born on 24 December 1957 in Kandahar. After being educated in Kabul, the fluent English speaker went to university in Simla, India.
In 1982, he joined the struggle against the Soviets and became director of information at the Afghan National Liberation Front (ANLF).
When the Taliban erupted on to Afghanistan's political scene in the early 1990s, Mr Karzai initially supported them.
However, by late 1994 he had become suspicious of the movement, fearing it had been infiltrated and was controlled by foreigners, including Pakistanis and Arabs.
That led him on the path which resulted in him leading his country following the Taliban's fall.
Mr Karzai long supported plans to build a broad-based government.
Mr Karzai was feted by Western governments
He first began lobbying for this after slipping into Afghanistan from Pakistan - where his family had lived in exile for some years - in October 2001.
At the time, US forces were carrying out military operations against the Taliban in Afghanistan.
When the news leaked to the Taliban that Mr Karzai was back in the country, they raided his hideout and set off in pursuit of him. He was rescued by US helicopters and special forces.
He is said to have played a key role in helping to oust the Taliban from their final stronghold of Kandahar in December 2001.
By the time a United Nations-sponsored conference met to set up an interim government for Afghanistan, Mr Karzai had strong American backing and was clearly being groomed for leadership.
After assuming the interim presidency, Mr Karzai wasted no time in carving out a high profile at home and abroad.
He swept on to the international stage in January 2002 at an international donors' conference in Tokyo, where he managed to attract pledges of more than $4bn to help rebuild Afghanistan.
He then embarked on a tour of world capitals.
Well educated, Westernised and stylish, Mr Karzai was feted by foreign governments.
He quickly built up considerable support at home, partly a tribute to his diplomatic skills, but also because many ordinary Afghans were disillusioned with the warlords who had returned to rule them.
Correspondents say that, as a royalist Pashtun from the south, he was accepted in a way few ethnic minority leaders from the anti-Taliban Northern Alliance would be. And, they say, his record as an anti-Soviet combatant served him well with former mujahideen followers.
Mr Karzai's critics have accused him of being an American stooge - particularly after the way in which the US intervened ahead of a second loya jirga in June 2002 to announce that the former king would not oppose Mr Karzai as a candidate for head of state.
A key plank of Mr Karzai's policies is the fledgling national army
The political horse-trading may have tarnished his image with some Afghans.
He has always faced great pressure to appear not to favour one faction over the other - nor to appear too beholden to the Americans.
That task was not eased by the clear need to upgrade security around the president following an attempt to assassinate him by suspected Taliban members in Kandahar in September 2002.
Nevertheless, Mr Karzai pressed on with proposals for Afghans to take a greater role in security.
Efforts are under way to train a 70,000-strong national army - a force Mr Karzai says will be loyal solely to his government and the only legal army Afghanistan will recognise.
But many doubt its ability to ensure security in the country.
Some observers predicted the Taliban were finished after the 2004 presidential election went off relatively smoothly.
But the country's hard-line former rulers came back with a vengeance and violence has risen steadily to levels not seen since the fall of the Taliban in 2001.
The Afghan conflict now presents a bigger policy headache for the US and their allies than Iraq, and threatens to destabilise neighbouring nuclear-armed Pakistan.
Relations with Pakistan have been generally strained and mistrustful during Mr Karzai's time in office. Islamabad has frequently denied it could do more to stop the Taliban launching attacks in Afghanistan from bases inside Pakistan.