Afghan President Ashraf Ghani's five biggest challenges
Afghanistan finally has a new president in place after a long election dispute - and Ashraf Ghani will want to waste no time in getting to work.
His swearing in follows months of uncertainty as allegations of fraud in the presidential elections led to a full recount of all votes. The stalemate was only resolved by a US-brokered deal to form a national unity government.
What are his top five challenges now he is in the top job?
Keeping it together
Despite both Ashraf Ghani and his closest rival Abdullah Abdullah publicly backing the US-brokered unity deal, some of Mr Abdullah's key allies have made it clear they have deep reservations. They believe Mr Ghani's victory was based on fraud.
So at the very top of the new president's list will be how to keep this newly-formed government together and turn it into a robust body.
It will have to reform the election system quickly and in time for next year's parliamentary poll. That is not easy and many Afghans worry that the fragile unity deal might not last long.
Putting Afghanistan back to work
Six months of uncertainty over the outcome of the election have had a devastating impact on an already weak economy, substantially dependent on foreign aid.
As a former World Bank economist with expertise in tackling the problem of failed states, there is no doubt Mr Ghani is well-qualified for the job of reviving the economy. But the biggest obstacle for him is the corruption widespread in Afghanistan.
Although Mr Ghani has said he will not tolerate corruption, any success will depend on whether or not he can deliver serious reform. His predecessor Hamid Karzai largely failed here.
Keeping people safe
The timing is precarious. Ashraf Ghani takes over just ahead of the withdrawal of international combat troops by the end of 2014. From next year, around 350,000 sometimes poorly-equipped Afghan forces will take on the war with the Taliban. This had been fought by a 150,000-strong Nato force backed up by the latest military hardware.
And while politicians have argued over election results, the Taliban have made significant gains in some areas. Mr Ghani used to head the commission which oversaw the transition of security responsibility, so he understands the Afghan military.
He also knows they will depend on US military aid for years to come. And unlike his predecessor, Mr Ghani has said he will sign the long-awaited Bilateral Security Agreement with Washington which will ensure that at least a few thousand foreign troops stay on.
To talk or not to talk?
Ashraf Ghani has said that the conflict in his country will be resolved through peaceful means, but he inherits a talks process with the Taliban which has gone nowhere.
Attempts to set up a political office for the Taliban in Qatar failed and even the release of dozens of Taliban prisoners appears to have done little to build trust between the government and leaders of the insurgency.
Many Afghans doubt Mr Ghani's prospects will be any better. The Taliban label both Ashraf Ghani and Abdullah Abdullah as "American puppets", the same term they used for Hamid Karzai. Developments on the battle field suggest that the Taliban are still more intent on fighting than talking.
And what can he do about his wife?
Ashraf Ghani faces a difficult choice when it comes to the future role and status of his wife, Rula. Mrs Ghani is a Lebanese-American and the two met in the 1970s when they were studying at the American university in Beirut.
Afghanistan's first ladies have always kept a low profile. But this time it seems things could be different.
Rula Ghani made her public debut earlier this year speaking at one of her husband's campaign rallies. The appearance stood out and some Afghan women activists believe a more active role for the new first lady could have a positive impact on women's lives.
But it's unclear how much of a prominent role she can really play in a deeply conservative, male-dominated society - and whether her husband will want her to try.