Imran Khan fulfilled his long-cherished dream of becoming the prime minister of Pakistan after a long struggle of 22 years since he entered politics but that was the easy part compared to what lies ahead.
Here are five of the most difficult challenges the country is facing which the cricket World Cup-winning captain has to address immediately.
Economy
Pakistan is teetering on the brink of defaulting on loan repayments. Asad Umar, likely to take over as the new finance minister, has said that they will decide by September end whether they will request the International Monetary Fund (IMF) for a second bailout in five years.
One of the biggest donors to the IMF, the US, has expressed fears that Pakistan could use the money to repay loans taken from China, though Pakistan denies this.
In the last five years, the budget deficit has steadily gone up and foreign currency reserves have dwindled. The rupee has repeatedly devalued resulting in the inflation going up.
Imran has promised to increase trade with India and usher in reforms which will make it easier to do business and boost tax collection which is abysmally low in the country.
It is feared that the economic woes will undermine one of his most popular promises of spending more on education and health.
Extremism
The security in Pakistan has improved by leaps and bounds after a crackdown against terrorist groups in the last few years.
But security experts say Pakistan is not addressing the root causes of extremism and terrorists still have the ability to carry out spectacular strikes. During the run-up to elections, suicide bombers targeted election rallies, killing over 200 people.
The new PM has often been called 'Taliban Khan' for his willingness to hold talks with extremists and catering to religious hardliners during the campaign.
Analysts say this may embolden the extremists and they may again try to disrupt the relative peace the country is experiencing after a long time.
Population growth
Pakistan, being a conservative country, doesn't have family planning norms in place and as a result, it has one of the highest birth rates in Asia with an average of three children per woman. This has led to the population increasing fivefold since 1960 to 20.7 crore at present.
This population boom is cancelling out the economic and social progress the country has made and if corrective steps are not taken, the country's natural resources will not be adequate enough to support the growing population.
Water shortage
Pakistan is staring at an ecological disaster if water shortage is not addressed immediately, say experts.
If the present situation continues, then by 2025 less than 500 cubic metres per person will be available which is one-third of water available in parched Somalia.
The political initiative is needed for building infrastructure to reverse the looming crisis though very little public information is disseminated on the virtues of water conservation.
Civil-military relations
Having been ruled by the military for nearly half of its 71-year history, the country saw the first ever democratic transition of power in 2013 giving rise to hopes that finally democracy is finding its feet in the country.
However, since then tensions simmered between the generals and former PM Nawaz Sharif, who wanted to assert civilian supremacy and repair ties with India.
Sharif, who was removed from his post in 2017 and arrested for corruption in July this year, has said that he and his party were targeted by the military which the latter denied.