Lt General Raheel Sharif, the third in terms of seniority, was appointed as Pakistan's new army chief and the man tipped for the position of army chief, Lt General Rashad Mahmood was appointed to the largely ceremonial position of chairman of the joint chiefs of staff committee, local media said on Wednesday.
Geo Television reported that Sharif, who hails from Lahore, was chosen by prime minister Nawaz Sharif from a list of four candidates sent to him by the outgoing army chief General Pervez Ashfaq Kayani.
Earlier, the favourite for the position was General Mahmood, who was the second senior most in the rankings and seen as the favourite of General Kayani.
General Raheel Sharif comes from a military family. Hailing from the Frontier Corps, Sharif's elder brother - Shabbir Sharif was a recipient of Pakistan's highest military award, the Nishan-e-Haider. He is also related to another war hero, Major Aziz Bhatti.
Sharif has worked extensively on countering India's cold start doctrine with more sophisticated responses.
In a message on Twitter, the Pak prime minister confirmed the appointment at a time when tension continues with India over Kashmir and as the United States seeks Pakistan's help in bringing peace to neighbour Afghanistan.
Sharif is seen as a moderate who views the militant threat inside Pakistan as just as important as the strategic tussle with India.
General Sharif will take over as head of the 600,000-strong army from General Ashfaq Kayani, who is retiring after six years at the helm.
The change of command comes with the country facing a daunting array of challenges -- a homegrown Taliban insurgency that has claimed thousands of lives, vexed relations with India and the winding-down of the 12-year NATO mission in neighbouring Afghanistan.
"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)," a retired senior army officer who Sharif has served under told Reuters.
The TTP is a group of Islamist militants in the country's lawless tribal areas next to Afghanistan. Sharif's appointment came as somewhat of a surprise as three other men had been seen as leading candidates.
Sharif, whose elder brother won Pakistan's highest military award for valour in the 1971 war with India, will formally take command on Thursday.
Departing commander Kayani has served as army chief since 2007 and has been given much credit for resisting the temptation to meddle overtly in politics.
When he confirmed his retirement last month he stressed that the armed forces "fully support and want to strengthen" democracy.
The general election in May marked a major landmark for Pakistani democracy as being the first time an elected government had completed its term and handed over power through the ballot box.
Nawaz, who made the appointment, will be hoping to avoid a repeat of events the last time he named an army chief -- General Pervez Musharraf overthrew him in a coup in 1999.
There has been much debate about how to deal with the campaign of violence waged against the state by the Pakistani Taliban.
The government has said it wants to pursue peace talks, but some have argued that a military offensive is needed to clear militant hideouts in the tribal northwest.
Analyst Hasan Askari said he thought the new commmander would take an uncompromising approach.
"He belongs to a family of soldiers, his father was a martyr, his brother was honoured with the highest military award, so I expect he will go for the extremist groups and clear the tribal areas," Askari told AFP.
"He has to secure the border with Afghanistan, so I think he will consult with his senior top brass officers and clear the troubled area along the Durand Line."
The Durand Line is the official name for the Afghan-Pakistani border.
(With Reuters, AFP inputs)
Poll: New Pak army chief appointed: Do you think coups are no longer possible in Pakistan?