Ashraf Ghani Ahmadzai has been sworn in as Afghanistan's president in a lavish ceremony at the presidential palace in the Afghan capital, Kabul.
The former finance minister will head a power-sharing government just as the withdrawal of most foreign troops presents a crucial test. Ghani replaces Hamid Karzai in the country's first democratic transfer of power since the 2001 US-led invasion toppled the Taliban.
Moments after Ghani took the oath, he swore in his election challenger, Abdullah Abdullah, as chief executive, fulfilling a political pledge he had taken to share power and defuse election tensions that had threatened to spark violence between the country's north and south.
Ghani, a former World Bank official and Afghan finance minister, wore a dark black turban popular in the country's south as he swore in his two vice presidents and then Abdullah.
Abdullah, a former foreign minister, spoke first and thanked Karzai for his service and the people of the country for casting votes in the millions despite the threat of attack from Taliban militants who tried to thwart the election process.
"We are committed as one in the national unity government," Abdullah said. "Our commitment will be fulfilled together as unified team to create national unity." Ghani Ahmadzai then congratulated Karzai for a peaceful and democratic transition of power, and he thanked Abdullah for making the national unity government possible.
"I am not better than anyone from among you. If I do any good, give me your support. If I go wrong, set me right," Ghani Ahmadzai said.
Karzai, the only president Afghanistan and the West have known since the invasion, wore a wide smile as he greeted his presidential guards upon entering the palace. He has said he is glad to be stepping down after more than a decade of what the US ambassador recently said was one of the most difficult jobs in the world.
The inauguration caps a nearly six-month election season that began when ballots were first cast in April. A runoff election in June between Ghani and Abdullah stretched on for weeks as both sides leveled charges of fraud.
The United Nations helped carry out what it said was the most thorough recount in its history, a count that reduced Ghani's vote percentage from 56% to 55%, but still gave him the win.