Pakistan has announced Lieutenant General Qamar Javed Bajwa as the new head of the country's army, ending weeks of speculation.

A spokesman for Prime Minister Nawaz Sharif said the 62-year-old would take over from the outgoing chief, Raheel Sharif, in a change-of-command ceremony on Tuesday. General Bajwa will become one of the most influential people in the country.

The Pakistani military is the sixth-largest in the world, and the 190-million-people country is one of only nine nations globally to possess nuclear weapons. The military is also particularly politically powerful, having ruled the south Asian state for about half of the 69-years since it became independent from Britain, and continuing to enjoy extensive powers even under civilian administrations.

General Sharif is retiring after completing a three-year term, in which he quickly became immensely popular for cracking down on domestic terror groups and bringing about a drop in violence.

He was so well liked that some Pakistanis reportedly demanded that his term in office be extended, but General Sharif always insisted he would step down as scheduled. He is the first army chief in two decades to do so.

General Sharif clashed repeatedly with the Prime Minister, who was previously ousted by a military coup in 1999, led by then-army chief Pervez Musharraf.

The Pakistani media reported there were other contenders for the role, including a more senior general, Zubair Hayat, who has instead been made chairman of the joint chiefs of staff committee.

It is believed General Bajwa may have been picked from him rivals for his unassuming personality, in the hope that he will help to restore harmony between the civilian and military leaderships.

A cabinet minister said Prime Minister Sharif picked General Bajwa because of his "low-key style". The politician, who asked not to be named, felt the incoming general would be more willing to cede control of key areas to the civilian government, an appealing prospect for Mr Sharif, who has long hoped to assert the supremacy of civilian rule over the army.

The minister said: “He is essentially a very low-profile person and after our last experience (with General Sharif) this is just a very important consideration; someone who doesn’t want the limelight at all."

Talat Masood, a retired general, told the Guardian he also believed the appointment of General Bajwa could soothe current tensions between the military and the prime minister.

“General Bajwa is not one of those who will try to assert his personality in order to dominate the political scene, or constantly be in the media,” General Masood said. “He is more reserved than his predecessor and that will help make the situation more harmonious with the government.”

However, experts have cautioned against assuming General Bajwa will remain neutral; when the Prime Minister chose General Sharif as army chief in 2013, it was because the general was the most apolitical figure among the candidates, sources close to the premier said at the time.

But once appointed, General Sharif maintained the army's strong influence within Pakistani politics. Though he did not overtly meddle and rarely made public political statements, he was seen as a key player in behind-the-scene decision making.

Analysts believe history could repeat itself, pointing out that all previous military leaders ended up challenging the prime minister's authority in some way once they began to represent the interests of the army.

Since returning to power in 2013, the Prime Minister Sharif has fallen out with the army over an attempt to prosecute General Musharraf for treason, and the antics of a pro-government private news channel that accused the army’s intelligence agency of attempting to assassinate a popular journalist.

According to the Guardian, General Bajwa may not be as popular with the public as General Sharif. He was reportedly selected for the role despite a vilification campaign on social media that spread claims some of his relatives were members of the Ahmadiyya community, an Islamic sect despised as heretics by religious hardliners.

It is not known how General Bajwa, an officer of 35 years who was trained by the Canadian military, leans politically, including on key ideological issues such as Pakistan's relationship with India.

But he is experienced, having held senior command positions in the country’s mountainous north, including the contested region of Kashmir.

In addition to managing tensions with India, General Bajwa is likely to continue his predecessor’s policy of fighting domestic jihadi groups, particularly the Pakistani Taliban.

Despite the improvements Mr Sharif brought about in national security, General Bajwa is expected to face serious challenges. Isis is trying to make inroads into the country ,and militant groups such as the Pakistani Taliban continue to stage large-scale bomb and gun attacks.

Since August, 184 people have been killed in three major attacks in the restive Baluchistan region alone, Reuters reported.

Abroad, Pakistan's relations with the United States, a long-time ally, as well as nuclear-armed rival India, have worsened over the past year.

Shadow lands: Pakistan - a nation under attack Show all 7 1 /7 Shadow lands: Pakistan - a nation under attack Shadow lands: Pakistan - a nation under attack 347098.bin In 2005, 216 people were reported killed in violence in Pakistan. By 2009, it was 25,000 AFP Shadow lands: Pakistan - a nation under attack 347096.bin Fighting fire with fire: a man flees a violent Sunni-Shiite clash in Islamabad Shadow lands: Pakistan - a nation under attack 347100.bin Off-target: Islamabad's Marriot Hotel, which has been attacked twice by suicide bombers who thought it housed a control centre for US drones Shadow lands: Pakistan - a nation under attack 347099.bin Pakistani Taliban commander Hakimullah Mehsud speaks to the media AFP Shadow lands: Pakistan - a nation under attack 347097.bin Tense negotiations: Pakistani Foreign Minister Shah mMehmood Qureshi and Hillary Clinton Reuters Shadow lands: Pakistan - a nation under attack 347094.bin A suicide bombing victim in a northern village in January AFP Shadow lands: Pakistan - a nation under attack 347095.bin Home safe: Sahil Saeed, aged 5, was released last month, but child kidnapping is rife in Pakistan Reuters

Both countries have accused Pakistan of harbouring Islamist militant groups. Islamabad has denied all such charges.

General Masood said the new army chief might also take a tougher line against militant groups that fight in Afghanistan and India.

“The change of command gives him an opportunity to do that and my impression is that he believes it is necessary,” he said.

“He will try to make Pakistan not become a reason for the world to point fingers.”