Raheel Sharif’s successor will face challenges ranging from an increasingly hostile India to the conflict in Afghanistan.
Islamabad: Pakistan's popular military chief is expected to stand down this week after winning the hearts of millions with his bruising campaign against Islamic militants, leaving a vacancy for arguably the most powerful job in the country.
Whoever steps into General Raheel Sharif's shoes will play an outsize role in national life, offering the armed reassurance against arch-rival India that many Pakistanis see as vital to their identity.
With the civilian government largely dismissed as corrupt and inefficient, the military offers a form of stability and steadfastness.
"The army is the only institution in Pakistan that is organised," analyst Hassan Askari told AFP.
"So the army has an advantage and also plays a role in politics, either openly or pulling strings from behind the scenes."
Sharif was the figurehead behind a widely-lauded crackdown against militancy that is credited with pushing Islamist extremists to the margins.
Many in Pakistan were so grateful the hashtag #ThankYouRaheelSharif went viral that some even called for the general to launch a military coup.
Critics say rights are being rolled back in the name of defeating terror, pointing to the creation of military courts and the resumption of hangings after a six-year moratorium.
But there is no sign of a course correction from military headquarters in Rawalpindi city, and the announcement on Monday that Sharif had begun a farewell tour scotched speculation he would extend his three-year tenure, set to end November 29, as previous military chiefs have done.
The general's decision won him praise for respecting democracy, even as disappointed Pakistanis swarmed social media to pay tribute.
His as-yet un-named successor will face challenges ranging from an increasingly hostile India to the conflict in Afghanistan, growing links between homegrown militants and Islamic State jihadists, and blowback from a Trump presidency.
He will also take control of the military's uneasy relationship with the civilian government.
The military has been in charge of Pakistan for more than half of its nearly 70-year history.
The country is nominally ruled at present by Prime Minister Nawaz Sharif.
But his administration is embroiled in accusations of corruption and waste, and increasingly finds itself playing second fiddle to a military that is already widely seen as controlling foreign policy and defence, leading to accusations it is carrying out a "creeping coup".
"General Sharif will be remembered for positing the military as a state within a state more than many of the guys before him," analyst Ayesha Siddiqa told AFP. "The manner in which Sharif pushed the envelope was unbelievable."
The power to choose the new military chief lies with Nawaz Sharif, though he is believed to be working off a shortlist supplied by the men in uniform.
The highest-ranking contender is the army's Chief of General Staff, Lieutenant General Zubair Hayat, previously responsible for the safety and security of the country's nuclear programme.
Behind Hayat in rank but seen by some analysts as a favourite, is Lieutenant General Ishfaq Nadeem, commander of the important Multan corps.
The others in the running are Lieutenant General Qamar Javed Bajwa, chief of the army's training and evaluation branch, and Lieutenant General Javed Iqbal Ramdey, respected for an operation to drive out the Pakistani Taliban in northwestern Swat Valley in 2009.
Analysts agree there may be little change in tack, especially with regards to Afghanistan, India and China.
"The new generals coming up next are all trained by Raheel Sharif," said analyst Ahmed Rashid, though he warned there would be more pressure on the civilian government to perform.
Much may depend on the relationship with Washington, which has supplied billions to the military for the fight against extremism since 2002.
Sharif helped to improve relations after a furore over the US killing of former Al-Qaeda leader Osama bin Laden, found hiding in Pakistan.
But choppy waters lie ahead. The incoming Trump administration has said little about Pakistan specifically.
However the president-elect's anti-Muslim campaign rhetoric, seeming desire to cut foreign spending, and business interests in India are ominous signs for Sharif's successor.