Pakistan named a new army chief on Wednesday, promoting a veteran infantry commander to the most powerful position in the troubled nuclear-armed nation battling a homegrown Taliban insurgency. General Raheel 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 -- the six-year Taliban campaign which has claimed thousands of lives, vexed relations with India and the winding-down of the 12-year NATO mission in neighbouring Afghanistan. Hours after the announcement, the government confirmed another crucial appointment with the naming of a new Supreme Court chief justice. Sharif is little known outside military circles but retired general Talat Masood, a defence analyst, said he represented "continuity" with the Kayani era. The Pakistani Taliban recently appointed hardline cleric Maulana Fazlullah as their new chief after his predecessor was killed by a US drone, raising fears of a new and bloody phase of the militants' insurgency. Masood said that in the circumstances, Sharif's experience of counter-insurgency and counter-terrorism operations made him the right man for the job. A veteran infantry commander whose elder brother won Pakistan's highest military award for valour in the 1971 war with India, Sharif will formally take command on Thursday. Prime Minister Nawaz Sharif passed over two more senior generals to appoint his namesake, who is no relation, and 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. 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. Taliban threat 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 commander 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. Sharif, 57, was commissioned into the Frontier Force Regiment in 1976 and has commanded numerous infantry units including two on the sensitive border with India. Before his elevation to the top job he was Inspector General Training and Evaluation, overseeing the army's training, in which role he is credited with revamping tactics in recent years. Part of the task for Sharif will be to maintain ties with the United States, which have been on the mend this year since plunging amid a series of rows in 2011 and 2012. The Pakistani military was humiliated by the May 2011 US special forces raid to kill Osama bin Laden in the town of Abbottabad, on the doorstep of its elite academy. But relations have improved lately and last month Washington announced it would release $1.6 billion in aid to Pakistan -- including $1.38 billion in military aid. Masood said he expected the new man to continue the rapprochement. "I think he will try to maintain the relation at a good level because the military needs the US and the US needs the military," he said.