By Samira Hussain
BBC News, Islamabad
Pakistan's government has named a new army chief ending months of speculation over who would land what many see as the country's most powerful job.
General Asim Munir, a former spy chief, replaces General Qamar Javed Bajwa, who retires on 29 November.
Gen Munir, the army's most senior general, is considered a close ally.
The appointment comes at a precarious time for a country where the military has always wielded great influence in politics and foreign policy.
Former Prime Minister Imran Khan, who was ousted by his opponents in April, has been at loggerheads with the new government and the military over the appointment of the army chief.
Pakistan is also facing an economic crisis: exports are falling, while the cost of food is soaring. It's also trying to recover from devastating floods earlier this year.
When Lt Gen Munir takes up his position at the end of the month, he will direct future relations with nuclear-armed rival India on one side, and the new Taliban government in Afghanistan on the other.
"It's not a political position but if you look at the post, this position has had a political role," says Fahd Husain, special adviser to the prime minister.
Since Pakistan was created 75 years ago, the army has seized power three times and directly ruled the country for almost four decades.
"Our democracy is weak," says Talat Masood, a former lieutenant general in the army. "The military has always tried to exploit that."
Lt Gen Munir's name was selected from a list of six potential candidates. The final decision on who becomes the next army chief is normally for the prime minister to make alone.
But the process often becomes a tussle between the outgoing army chief and the prime minister, as both try to push for someone sympathetic to their interests.
This time around, it was even more fractured. Current Prime Minister Shehbaz Sharif sought the counsel of his older brother, former Prime Minister Nawaz Sharif, who is believed to be preparing a political comeback.
Mr Khan, their political rival, spoke publicly about the appointment, saying the current leadership is corrupt and should not be allowed to make the decision.
It is widely acknowledged that Mr Khan came to power in elections in 2018 with the help of Pakistan's army and intelligence services, despite denials from the former PM and the military.
He was then pushed out of the job in April this year after allegedly falling out with the military.
Since then, Mr Khan has publicly condemned the army and its outsized role in the country's politics, even accusing members of the military of playing a role in an attack earlier this month when he was shot in the leg.
Those allegations are denied but Mr Khan has built a narrative among his many supporters that the army has directly inflicted harm on him and those that back him.
This week Gen Bajwa, who served two three-year terms as army chief, acknowledged the military's role in politics over the last 70 years.
Speaking at a ceremony for those who have died in the line of duty, Gen Bajwa said that would change.
"That's why, after a lot of thinking, the army decided not to meddle in any political affairs," he said, adding: "I can assure you that we will strictly adhere to this and will continue to in the future."
Other outgoing army chiefs have echoed similar sentiments in Pakistan but to no avail.
Fahd Hussain says under Gen Bajwa's leadership, the army became more deeply involved in politics.
"The government and opposition parties cannot sit in the same room. There is no sign of any political dialogue. There is no move to find a political solution."
Given this, Mr Hussain thinks the army will end up seizing control again.
Mr Masood is more hopeful, believing this could be the moment when Pakistan can strike a better balance between military and civilian rule.
"It's a great opportunity for the next chief to really transform the very character of the military in the sense of not interfering in politics and confining itself to professional matters only," he says.
"But that may be wishful thinking."