Pakistan named a career infantry officer considered a moderate as army chief on Wednesday as the country fights a Taliban insurgency and seeks accord with the United States on how to stabilise neighbouring Afghanistan.
Prime Minister Nawaz Sharif announced that Lieutenant-General Raheel Sharif, brother of a war hero, would take charge of the world's sixth-largest army, with a formal handover from General Ashfaq Kayani on Friday.
The new army chief is not related to the prime minister.
The announcement comes as tension with arch-rival India over disputed Kashmir is rising and as the United States seeks Pakistan's help in bringing peace to Afghanistan ahead of the withdrawal of most Western forces there next year.
The army chief is arguably the most powerful person in Pakistan, with the military having ruled the country for more than half its 66-year history since independence from Britain.
Nawaz Sharif has declared he wanted to disentangle the military from politics but the military is unlikely to relinquish its hold at such a sensitive time.
"Nawaz should know that whether it is Raheel Sharif or someone else as army chief, he won't do the PM's bidding - he will be driven by the institution first and last," said security analyst Hasan Askari Rizvi.
The prime minister also named water and power minister Khawja Muhammad Asif as defence minister. The prime minister had held the portfolio since being elected in May.
Raheel Sharif considers the militant threat inside Pakistan as important as the strategic tussle with India, a retired senior army officer who Sharif has served under told Reuters.
"Sharif has played a big role in convincing the army that the Tehrik-e-Taliban Pakistan (TTP) and assorted militants inside Pakistan are as big a threat (as India)," the officer said.
The TTP, or Pakistani Taliban, is a group of Islamist militants based in the country's lawless Pashtun tribal areas along the border with Afghanistan.
Sharif, 57, received his military commission in 1976 and studied military leadership in Germany, Canada and Britain. He commanded several infantry units, including the Sixth Frontier Force Regiment along the disputed Line Of Control in Kashmir.
Perhaps his most important contribution has been his role in the reshaping the country's strategic policy.
In 2007, the military undertook an ambitious programme of re-thinking its strategic doctrine, following the appointment of Kayani as army chief.
The new approach was seen as a move away from a focus on the rivalry with India to a more nuanced policy which considered the internal threat from militants equally as pressing.
Sharif was one of the architects of the new doctrine, army insiders say.
His brother, Major Shabbir Sharif, received two of the country's highest military awards for his action during the 1971 India-Pakistan war in which he was killed.
Kayani announced last month he planned to step down after six years in the post, presenting Pakistan's new leader with his toughest choice since coming to power in May.
In 1999 and only a year after appointing him, Nawaz Sharif was ousted from power by his army chief, General Pervez Musharraf. He will be keen to ensure history does not repeat itself.