General Ashfaq Kayani, arguably the most powerful man in the nuclear-armed country, is expected to step down after six years in November - presenting Pakistan's new premier with the toughest of choices yet since coming to power in May. (Agencies)
The army has ruled Pakistan for more than half of its history since independence in 1947. But even during periods of civilian rule, the army has set security and foreign policy.
Prime Minister Nawaz Sharif says he wants to disentangle the military from politics and he has taken over the foreign affairs and defence portfolios in an apparent show of determination to wrest those responsibilities from the army.
But the military is unlikely to relinquish its hold at such a sensitive time. As Western forces prepare to withdraw from Afghanistan by the end of next year, Pakistan is striving to prevent old rival India from increasing its influence there.
Illustrating the difficulties Sharif might face in setting foreign policy, his bid to improve ties with India has been undermined by violence between Indian and Pakistani forces in the disputed Kashmir region. While the two armies trade fire and blame, Pakistan's civilian government can only look on.
Nevertheless, the Pakistani military has meddled less in politics under Kayani, earning him a reputation as a pragmatic leader willing to ease the military's grip on political affairs and publicly endorse democracy.
Sharif, himself ousted in a military coup in 1999, has a difficult relationship with the army, and picking Kayani's successor could be the defining moment of his second term.
"It's not just that Nawaz wants someone he can trust and who he can use to neutralize the army's political role," one retired senior military official said. "The army also wants someone who will be able to work with Nawaz."
The job has been at the center of a drawn-out guessing game and officials would not speculate publicly on it. But in private interviews with army officers, politicians and diplomats, several names have emerged as possible contenders.
Those include Lieutenant General Rashad Mahmood, the current chief of general staff, Lieutenant General Tariq Khan, who is considered pragmatic on U.S. relations, and Lieutenant General Haroon Aslam, the most senior official after Kayani.
Some have even floated the idea that Kayani - whose term was extended for three years in 2010 to the discontent of some of the top brass climbing the ranks below him - might end up staying in the job for another three years.
Kayani, a chain-smoking, unsmiling man known for his low-key manner, is dubbed the Quiet General of Pakistani politics. His public statements in support of Pakistan's transition to democracy have earned him respect in the West.
In a speech just before the May election, Kayani said a bad democracy was better than the worst kind of dictatorship. And yet his words hardly concealed a warning that the army's support for democracy would not be available forever.
"Everyone says that under Kayani the army is now transformed and we can trust in its democratic credentials. But let's not jump the gun," said a source in Sharif's administration.
"One era of soft military leadership does not make for a lasting legacy. The civilians will have to work hard to make sure everyone knows their limits."
But even under Kayani some generals have grumbled quietly over the softer approach, and a new army chief might feel pressure to exert his authority over the civilians.
This could set the military on a collision course with Sharif again, like in 1999 when he was overthrown by General Pervez Musharraf and jailed. Just a year earlier, Sharif had picked Musharraf as his new Army Chief.
"There are no guarantees the current status quo will last beyond Kayani," said one diplomat in Islamabad.
Criticizing the top brass has long been taboo. But that too has changed after the Supreme Court ruled last year that the military must stop interfering in politics, eroding the generals' untouchable status in the eyes of the public.
The army's standing also took a hit over a secret 2011 operation by U.S forces to kill Osama bin Laden on Pakistani soil. Ordinary Pakistanis saw it as a violation of sovereignty that the army had failed to prevent.
Technically, Kayani has to come up with a shortlist of three candidates and send it to Sharif for approval. In reality, Sharif may not have much choice but he will at least try to strike a semblance of balance, officials say.
"A super assertive new chief whose first priority is to win back the former glory of his institution and a prime minister who likes being the boss and won't share the spotlight with anyone. That's an interesting combination," said one official close to outgoing President Asif Ali Zardari.
"The new crop of generals are not even remotely as patient as (Kayani) when it comes to the screw-ups of civilian leaders."
General Ashfaq Kayani, arguably the most powerful man in the nuclear-armed country, is expected to step down after six years in November - presenting Pakistan's new premier with the toughest of choices yet since coming to power in May.