In the early hours of 3 January, Iraq’s prime minister, Adel Abdul Mahdi, frantically phoned his advisers. “Something big has happened,” he said, summoning them to a meeting in his office. “You need to come now.”

Like their boss, the advisers had heard the boom of the explosions that crunched into the airport road just after 1am, and their phones had been ringing incessantly. Each call had brought the unthinkable closer to shocking reality: Qassem Suleimani, the revered commander of Iran’s Quds Force and the most powerful man in Iraq, had been killed, and so had nearly all of his closest aides. Throughout 17 years of post-Saddam Hussein bedlam across the Middle East, there had been little to rival this moment.

Profile Who was Qassem Suleimani? Show Qassem Suleimani, killed by a US drone strike in Baghdad, had become well known among Iranians and was sometimes discussed as a future president. Many considered Suleimani to have been the second most powerful person in Iran, behind supreme leader of Iran Ali Khamenei, but arguably ahead of President Hassan Rouhani. He was commander of the Quds Force, the elite, external wing of the Iran’s Islamic Revolutionary Guard Corps, which the Trump administration designated as a terror organisation in April last year. He was born in Rabor, a city in eastern Iran, and forced to travel to a neighbouring city at age 13 and work to pay his father’s debts to the government of the Shah. By the time the monarch fell in 1979, Suleimani was committed to the clerical rule of Ayatollah Ruhollah Khomeini, and joined the Revolutionary Guards, the paramilitary force established to prevent a coup against the newly declared Islamic Republic. Within two years, he was sent to the front to fight in the war against the invading Iraqi army. He quickly distinguished himself, especially for daring reconnaissance missions behind Iraqi lines, and the war also gave him his first contact with foreign militias of the kind he would wield to devastating effect in the decades to come. By the the time the Iraq government fell in 2003, Suleimani was the head of the Quds force and blamed for sponsoring the Shia militias who killed thousands of civilian Iraqis and coalition troops. As fighting raged on Iraq’s streets, Suleimani fought a shadow war with the US for leverage over the new Iraqi leadership. Once described by American commander David Petraeus as ‘a truly evil figure’, Suleimani was instrumental in crushing street protests in Iran in 2009. In recent months outbreaks of popular dissent in Lebanon, Iraq and Iran were again putting pressure on the crescent of influence he had spent the past two decades building. Violent crackdowns on the protests in Baghdad were blamed on militias under his influence.

Eighteen months before his death, Suleimani had issued Donald Trump a public warning, wagging his finger and dressed in olive fatigues. “You will start the war but we will end it.” Michael Safi Photograph: Mehdi Ghasemi/AFP

Interviews with seven people familiar with the immediate aftermath of the deadly US airstrike, including officials in Iran and Baghdad, have revealed a scene of chaos and dysfunction as the identities of those killed were revealed.

“There were 11 bodies pulled from the wreckage,” said one official privy to the panicked conversations that swirled through the corridors of power that morning. “We are talking about the entire inner sanctum of the Quds Force. This wasn’t just Hajj Qassem [Suleimani] and Abu Mahdi [al-Muhandis]. This was everyone who mattered to them in Iraq and beyond.”

Another source, a western intelligence agency, was more circumspect, suggesting that those killed may have been less decisive in the Iranian nexus than the Iraqis believed. “However, the [assassinations] may have significant repercussions for the relationship between the [Quds Force] and Iran-aligned groups in Iraq in the near term,” an official said.

In the 40-day mourning period to mark the Iranian general’s death, which ended last Thursday, the fallout in Iraq has barely subsided. If anything, its impact has become more acute there, as well as in Suleimani’s homeland of Iran, and elsewhere in a region he had come to dominate like no other figure.

From the bunkers of south Beirut to the battlefields of northern Syria and the combustible streets of Iraq, the loss of Suleimani and his entourage has derailed much of Iran’s momentum in the region and exposed to rare vulnerability the opaque Quds Force it has used to project its influence over two decades.

The assassination has also shone a light on the complicated relationship between the Iranian leadership and the Iraqi government, senior members of which have scrambled ever since to resurrect Suleimani’s core regional projects located as far away as the Lebanese capital and Damascus. The reckoning started as soon as the dead were buried.

As well as soul searching about how best to regroup, there have been recriminations about how Suleimani and his entourage were able to be killed in the first place.

“The Iraqi government had four fleets of cars that handled such visits,” said one adviser, ruefully. He, like the others spoken to, refused to be identified. “They cost us a fortune. They had well-rehearsed routines that would have looked like that scene in Body of Lies for a drone. For some reason, that didn’t happen that night.”

Timeline The buildup to Qassem Suleimani's death Show A rocket attack on an Iraqi military base near Kirkuk kills an American contractor and injures US and Iraqi soldiers. The US blames Shia militia group, Kata’ib Hizbullah (KH) The US conducts retaliatory airstrikes against five KH bases in Iraq and Syria, saying there had been 11 attacks against Iraqi bases hosting coalition forces in Iraq over the past two months Protesters storm the US embassy in Baghdad, trapping diplomats inside while chanting “Death to America” and slogans in support of pro-Iranian militias. At one point they breached the main gate and smashed their way into several reception rooms. The rampage was carried out with the apparent connivance of local Iraqi security forces who allowed protesters inside the highly protected Green Zone In a drone strike ordered by US president Donald Trump, the US kills Iranian general Qassem Suleimani while he was being transported from Baghdad airport

Suleimani had arrived at Baghdad airport in the early hours after a short flight from Damascus, which had been a transit hop after spending a week in Beirut alongside the leader of Hezbollah, Hassan Nasrallah.

Lebanon, and the powerful militia-cum-political-bloc that runs the fractured country, had long been central to Suleimani’s efforts, the sum of which were to threaten the very existence of Israel.

Suleimani and Nasrallah were the two most powerful figures within the Iranian-aligned network of proxies – at which Hezbollah sat at the apex. The pair had been friends on most levels, and rivals on others, and it was to Nasrallah that Iran turned after the general’s death.

Women gather at the Grand Mosalla in Tehran to mourn during the 40-day memorial for Suleimani. Photograph: Wana/Reuters

The chief aide to Abdul Mahdi, Mohammed al-Hashimi, was sent to Beirut to try to convince Nasrallah to step into the void. Members of Iraq’s Shia groups also made the journey and, over a week in mid-January, agreed to stop infighting that had splintered the groups in Iraq and, more importantly, weakened the PMF – the powerful body of militias raised after the Islamic State rampage in Iraq, which had since been turned into a formidable body, backed by the Iraqi state.

Two senior sources in Beirut say Nasrallah agreed to help fill the gaping hole left by the deaths of Suleimani and Muhandis. But there were limits to what he could do. He had lived a life even more in the shadows than the Iranian general for the past 14 years. And a drone strike from a night sky was unlikely to make him feel safer. Travelling to Iraq, or Syria, to rally troops was going to be a non-starter. Instead, Iran’s proxy networks would need to travel to Lebanon. Nasrallah would make do from there.

On Sunday night, in a speech to mark the end of the official Shia Islamic mourning period, Nasrallah appeared to embrace a broader regional outlook, speaking at length about the PMF.

“It is required to preserve the Popular Mobilisation Forces, because America wants to eliminate it, seeing as it is among Iraq’s strength guarantees,” he said. “I tell the dear, loyal and aggrieved Iraqi people that the first responsibility for responding to the assassination of Abu Mahdi al-Muhandis and Qassem Suleimani falls on their shoulders.”

Before Nasrallah’s speech, a statue of Suleimani was unveiled in the Lebanese town of Maroun al-Ras, a short distance from the border with Israel. Its appearance was quickly condemned by rival Lebanese leaders, who have long seen both men as acting in Iran’s interest at the expense of their own country.

“The establishment of the Suleimani monument in the south has nothing to do with the confrontation with Israel,” said Ashraf Rifi, a former justice minister. “But rather, with the assertion of Iran’s mandate over Lebanon. The [Iranian] Quds Forces did not fight for Jerusalem but rather destroyed Syria and Iraq and transformed Lebanon into a failed state.”

In Syria, meanwhile, recent advances by forces fighting on behalf of the regime in the north-west are seen as partially being a reaction to the assassination. Labib al-Nahas, an official with the anti-Assad opposition, said Iran had urged its proxies to act in recent weeks, a factor that was proving decisive on the battlefield.

An Iranian cleric pays tribute at the Valley of Peace cemetery in Najaf. Photograph: Alaa al-Marjani/Reuters

“Iran after Suleimani’s death is more obsessed in asserting its regional dominance in general, and especially in Syria, and decided to rely solely on themselves and their direct influence rather than on any fragile partnerships,” he said. “Lebanese Hezbollah, Iraqi al-Nujaba militia, along with other minor groups of Shia foreign fighters and Syrians are taking the lead in the attack on Aleppo fronts.”

The direct Iranian role in northern Syria has partly allayed concerns in Iran that the Quds Force command and control had been shattered beyond repair, and that Suleimani had taken a list of secrets and contacts to the grave.

In the week after his burial, one of his family members called the Iranian supreme leader’s office with news. “She wanted to hand over large numbers of boxes and suitcases with his personal notes and memoirs,” an official said. “He had written everything down and, in some cases, left voice cassettes. It was all there after all. It’s just going to take a long time to piece together.”