Pakistan will hold a national election on Thursday to elect a new government, with multiple crises plaguing the nuclear-armed, South Asian nation of 241 million.
Here are some of the challenges that will confront the government that takes charge:
TREADING A NARROW ECONOMIC RECOVERY PATH
Pakistan narrowly averted sovereign default last summer through a last-gasp $3 billion bailout from the International Monetary Fund (IMF) - but the lender's support ends in March, following which officials believe a new, extended programme will be needed.
Negotiating a new programme, and at speed, will be critical for the new government, which will take over an economy beset by record high inflation and slow growth caused by tough reforms.
A new programme means committing to steps needed to stay on a narrow path to recovery, but which will limit policy options to provide relief to a deeply frustrated population and cater to industries that are looking for government support to spur growth.
LOWERING POLITICAL TEMPERATURES
Political tensions have been high in the run-up to the election due to what former prime minister Imran Khan has called a crackdown on him and his party. The former cricket star has been in jail since August, angering his millions of supporters.
He has been sentenced to various jail sentences three times in the last week but more cases are pending against him - including one that accuses him of ordering violent attacks on military installations, which could entail the death sentence.
Khan maintains mass popular support in Pakistan, and a continued crackdown and his remaining in jail would only stoke tensions at a time when stability is needed to attract foreign investment to shore up the economy.
LIVING WITH THE MILITARY
Pakistan's military has long held sway over the country but its role has grown even more pervasive in recent years. Khan says the military launched a crackdown on him and his party after they fell out on policy decisions when he was the prime minister. The military denies this.
The military's role in economic decision-making has since been formalised by its representation in a new high-powered body called the Special Investment Facilitation Council. Retired and serving generals are on key posts in many state institutions.
The new government will need to maintain a balance between keeping the country's powerful generals happy while charting out its own policies.
In the past, elected governments have been ousted by military intervention, including three coups or indirect pressure from generals. Not a single prime minister has completed a full five-year tenure in Pakistan's 76-year history.
DEAL WITH RISING MILITANCY
Militant attacks have risen over the past 18 months after a lull when many Islamist groups were driven into neighbouring Afghanistan with a military operation in 2014.
The groups - particularly the Tehreek-e-Taliban Pakistan (TTP) - reorganised in Afghanistan after the Taliban returned to power there in 2021, and have been reportedly using advanced weaponry left behind by NATO-led forces.
Militants have carried out a string of high-profile attacks and returned to strongholds inside Pakistan. But Islamabad's limited fiscal space limits its ability to fund another sustained military operation.
An ethno-nationalist Baloch insurgency in the southwest, which also targets the interests of key ally China, has picked up steam. Beijing has invested heavily in mines in the mineral rich Balochistan province and in the strategic port, Gwadar.
DEALING WITH THREE HOT BORDERS
The TTP attacks have caused unprecedented friction between Islamabad and the Taliban, who were previously believed to have close ties, as has Islamabad's expulsion of hundreds of thousands of Afghans, many of whom have lived in Pakistan for decades.
Pakistan and Iran shared tit-for-tat air strikes on purported militant bases on each other's soil last month, and while the two seem to have fixed ties since, the incident has opened up a new security worry for Pakistan on its western border.
Meanwhile on its eastern border, fresh tensions have risen with old foe India after Islamabad accused New Delhi of running an assassination campaign inside Pakistan.
India is also going to the polls by May, and a return to power for India's Hindu nationalist government with a heavy mandate could further complicate matters for Pakistan's new government.