Pakistan's ISI chief Rizwan Akhtar faces daunting challenges
When he takes over the intelligence service ISI, Lt Gen Rizwan Akhtar will become one of the two most powerful men in Pakistan, answerable only to the army chief.
While most intelligence agencies concern themselves with threats to national security, the ISI's remit extends to virtually all aspects of Pakistani life.
Gen Akhtar inherits a highly disciplined and powerful organisation with staff and informers deployed throughout the country's big cities and small towns.
The ISI's capacity to enforce its will - by brute force when it deems it necessary - makes it the only state institution of which no Pakistani, however rich and powerful, would want be on the wrong side.
The business and political elite may laugh at the tax authorities, bully the police and manipulate the judicial system - but none of them dare cross the ISI.
But for all the authority he will command, Gen Akhtar faces daunting problems at home and abroad.
The US drawdown in Afghanistan brings added problems: Pakistan faces a period of relative international isolation.
Accusations of duplicity
Many senior US officials are highly critical of Pakistan.
They believe the billions of dollars they pumped into Islamabad after 9/11 - much of it channelled through the ISI - was rewarded by years of Pakistani duplicity.
Some even go so far as to say that Washington's long war in Afghanistan failed because of Pakistani support for the Afghan Taliban.
Regardless of how fair this charge may be, Gen Akhtar will find many of his US counterparts simply won't believe what he says. The trust has gone.
Nevertheless, his relationship with Washington will be manageable.
As the new ISI chief knows, the US cannot contemplate the complete collapse of a nuclear state.
In 2008, when he was a brigadier, Gen Akhtar attended the US Army War College in Pennsylvania.
An academic paper he wrote there argued that Pakistan "must aggressively pursue rapprochement with India".
The comment has led to speculation that Gen Akhtar might reach out to Delhi.
But the paper was written when Pakistan's then military leader General Pervez Musharraf was offering Delhi compromises on Kashmir: Rizwan Akhtar's analysis was broadly in line with official thinking in Islamabad at the time.
Today the atmosphere is very different.
The new Indian Prime Minister, Narendra Modi, has made frequent visits to Kashmir and his party has talked about rescinding Article 370 of the constitution that gives Jammu and Kashmir special autonomous status.
In recent weeks there has been a significant escalation of artillery fire traded by the Pakistan and Indian armies near the Line of Control.
There is a sense in the international community that the Kashmir dispute has reached a stalemate.
But there is deep, persistent frustration at the highest levels of the Pakistan military that the Kashmir cause has not received more international attention and that the dispute remains unresolved.
Gen Akhtar will be under pressure from many of his military colleagues to be more assertive on the issue, and to stand up to Mr Modi.
But he has limited room for manoeuvre.
Should Pakistan-based militants cross the Line of Control and mount a spectacular attack there would, in all likelihood, be a ferocious Indian response.
Pakistan also faces uncertainty on its western borders.
Ever since the days of the anti-Soviet jihad, the ISI has been a big player in Afghanistan.
Today, the leadership of the Pakistan Taliban, which seeks to overthrow the Pakistani state and which has killed many ISI officers, is sheltering in Afghanistan.
Gen Akhtar will want to keep open Islamabad's lines of communication with the Afghan Taliban - not least to dissuade them from making common cause with their Pakistani counterparts.
Islamabad may consider the new Afghan President, Ashraf Ghani, an improvement on his predecessor Hamid Karzai, but the ISI is acutely aware that some security officials in Kabul believe sheltering the Pakistani Taleban helps balance Pakistan's good relations with the Afghan Taliban.
On the domestic front the ISI has notched up significant victories of late.
When the country's biggest TV channel, Geo, dared suggest that the ISI might have been behind an assassination attempt on its highest profile anchor, the ISI simply called for the channel to be taken off air and it was.
The move has had a significant chilling effect. While Geo TV has seen its audience share and profits squeezed, other channels have understood the ISI's message and Pakistan's TV journalists are more timid today than they were.
Although the ISI has reined in the media, it is faced with a highly unstable political situation.
Prime Minister Nawaz Sharif is showing no sign of backing down on his plans to put Pervez Musharraf behind bars on treason charges.
Many in the army consider such an outcome intolerable, and want Mr Sharif removed from power.
That could not happen without the ISI's close involvement.
General Akhtar has a reputation for being cool under pressure.
Given the dramas that are likely to unfold on his watch, he will need all the unflappability and composure he can muster.