To understand Esmail Qaani, who replaced Qasem Suleimani as the commander of Iran’s Islamic Revolutionary Guards Quds Force, you must look at his two decades of work in Afghanistan and Pakistan.

He might be unknown in the region to the West of the country, but his eastern neighbours know him well, from Kabul and Islamabad, to Tajikistan, Uzbekistan and even in India, a country that worked with him to support the overthrow of Afghanistan’s Taliban government in the 1990s.

Mr Qaani is media-shy and less bombastic than his predecessor, but no less lethal. After the September 11, 2001, attacks in the US, his proxies on the ground co-operated with US military to help secure Afghanistan, exploiting a downturn in US relations with Saudi Arabia, Egypt, Pakistan, and other Cold War allies.

Tackling a nuclear-armed Pakistan without provoking a full-frontal confrontation might be one of Mr Qaani’s enduring legacies. He created an impeccable spy and terrorism network that operated inside Pakistan for more than a decade until 2015, destabilising the Balochistan and the Pakistani business hub city of Karachi. He orchestrated spectacular attacks that were meant to scuttle the ambitious joint China-Pakistan economic corridor linking western China to Pakistan’s Gwadar port on the Arabian Sea.

Mr Qaani used his Pakistan links to raise the Zeynabiyoun militia, which started as a formidable sectarian brigade of Pakistani volunteers to fight in Syria, until it was busted by Islamabad. These cells preyed on poor Pakistanis from the Shia minority, deploying their religious fervour to fight Iran’s wars.

Adding to Pakistan’s woes, the IRGC and Quds Force often used Pakistani citizens or stolen passports for terrorism and espionage. For example, in March 2017, Pakistani Syed Mustufa Haidar Naqvi was jailed in Germany for spying on Israeli interests. German investigators proved he worked for the Quds Force, and was recruited when he came to Germany in 2012 to study.

Another example is an assassination attempt in 1985 on the now late Emir of Kuwait, Sheikh Jaber Al Ahmed Al Jaber Al Sabah. The two Iranians involved in the attack carried Pakistani passports. It had been planned and executed by Abu Mehdi Al Muhandis, an Iraqi militia commander who was killed in the same drone attack that killed Suleimani on January 3.