The Iranian missile strikes on two American bases in Northern Iraq were supposed to draw a line under the crisis set off by the assassination of General Qasem Soleimani of Iran’s Quds Force and his Iraqi offsider Abu Mahdi al-Muhandis.

Far from it: both sides, Washington and Tehran are waiting for the next move in a strange game of chess in which they seem to be forgotten the conventions and rules of play.

A major factor is Trump’s unpredictability – it seems to scare both the Iranian and Iraqi governments, not to mention quite a number of officials in and around Washington DC.

Both principal victims of the US drone attack at Baghdad airport last week were major players, and will prove very hard to replace. Both were not without controversy as commanders, subversives, and innovators in urban guerrilla warfare. The masses that turned out for the procession of funeral ceremonies of Qasem Soleimani concealed the controversy of his career and position – among foes, allies and even the regime he served.

Both were innovators – and both, had they lived, would have been architects of their country and community’s counter strike in the new phase of confrontation with America.

They were partners at the inception of Lebanese Hezbollah – the model of many Shiite militias across Lebanon, Syria and Iraq, which they commanded for more than 20 years. Hezbollah, led by Imad Mugniyeh and sponsored by Iran, pioneered suicide car and truck bombs. In October 1983 these were used to blow up a US Marine base in Beirut, killing 241 American military personnel and 59 French paratroopers at their base.

Just two months later, at the beginning of December 1983, an underground cell of the Shiite Dawa movement set off bombs at the French and American embassies, the airport and several commercial sites in Kuwait. The plot was masterminded by Abu Mahdi al-Muhandis, who was killed last week alongside Qasem Soleimani. Muhandis fled to Iran, where he married, and in his absence from Kuwait was sentenced to death.

In exile in Iran he would continue to plot against the Sunni regime of Saddam Hussein in Iraq, and its allies. After Qasem Soleimani took command of the al Quds commando of Iran’s Revolutionary Guard Corps in 1998, they became allies.

It is alleged by Israeli and US sources that Soleimani was at a crucial meeting in Damascus with the Hezbollah founder-commander Imad Mugniyeh in early 2008, when the latter was assassinated by a joint CIA – Israeli Mossad operation. The details are extremely confused – not least because the streams of US and Israeli information give two different dates for the killing, either 30th January or 12th February. But the Israelis allege that their operation, directed over a radio link by their head of the armed forces, General Ashkenazy, and prime minister Ehud Olmert, wanted to hit Soleimani as well as Mugniyeh. At the last moment President George W Bush said no, and the commando waited for the Iranian to leave by car, before detonating the bomb.

The American-led incursion into Iraq of 2003 gave Soleimani and the Quds force the big opportunity in establishing the power of the Shia factions and militias following the overthrow of Saddam Hussein. They retooled guerrilla tactics, especially with the introduction of shaped rounds in homemade mortars and the new form of booby trap roadside bomb, as deadly as it is cheap, known in Nato-speak as an Improvised Explosive Device, or IED. They were exported across the Middle East and adapted with great cunning by the Afghan Taliban. British soldiers felt the brunt of IEDs in Afghanistan and in Basra, which came to be an informal Quds force satrapy.

Along with the Americans and British, the Israelis have been prime Quds and Hezbollah targets. The multi-sided war in Syria gave Soleimani fresh opportunity, with his forces shipping new precision guided missiles and rockets to his affiliates in the Syrian militias as well as Lebanese Hezbollah. Now most strategic targets, Tel Aviv airport and the large coastal power plants included, are thought to be within range of Hezbollah rocketry.

This has accelerated a growing row with leading politicians in Iran and among some parts of the military command. Since 2011, and the disruptions of the Arab Spring, Soleimani began to move from shadowy guerrilla magician, to globe strutting military statesman, not without a touch of megalomania according to critics.

One of his critics was Iran’s president, Hassan Rouhani. The commander and the president began having open, quite public, disagreements. Rouhani thought the rock star guerrilla was demanding too much money for his force, which is only a small part of the Islamic Revolutionary Guards Corps. Soleimani publicly opposed Iran’s international agreement on nuclear development, the JCPOA of 2015, which Rouhani promoted. Reluctantly the supreme leader Ayatollah Khamenei had to side with the politician, and not the soldier.

Rouhani was critical of what he saw as the failures of the general, especially in the backing of the Houthi in Yemen, and the cavalier disposal of Iranian allied forces in Syria. On one occasion Soleimani sent 4,000 Iranian-backed militia to fight in the Idlib pocket, without consulting superiors in Iran’s forces. More public was the row about the forward basing of new Iranian rockets and missiles in bases in Syria. From one base, T4 at Tiyas, an attack drone was launched into northern Israel. The Israelis responded by bombing T4 twice in the spring of 2018 and hitting a roster of other bases used by Iranian-sponsored forces. Rouhani suggested that the lives of Iranian had been risked needlessly.

A further complication, which also affected the umbrella command of Popular Mobilisation Forces – the Shiite militias – under Abu Mahdi al-Muhandis, is the growing expense of the Hezbollah groups. Under Soleimani’s guidance, Lebanese Hezbollah became a fully-fledged fighting army, something far more than a militia group, in the war in Syria. The cost has been huge in terms of casualties – of a force of around 10 to 15,000 at least 2,500 have been killed and more than that wounded, many damaged for life. Part of the deal to get the Hezbollah fighters into Syria was that Iran would pay senior commanders’ salaries, fund restocking of weaponry, and pay pensions and compensation for war widows. There was to be a similar financial understanding for the Iraqi PMF militias once on operations.

He has now generated a crisis for both Iran and Iraq, especially the government of acting prime minister Adel Abdul al-Mahdi, a former protégé, but now increasingly a critic, of Tehran. Iran, strapped by US-led sanctions, no longer can access the necessary currency. The money for the militias has to be laundered through the corrupt back channels and byways of the Iraqi regime and its affiliates, which they can ill afford.

Iran is cut off from the dollar market. It sells about 225,000 barrels of crude per day on a long term contract with China. Apart from that, trade really is the scrapings of the barrel. The heavy fuel oil at the bottom of the reservoirs is smuggled into Iraq where it can be marketed easily because it does not bear the specific signature of finer crudes from known oilfields.

Both Muhandis and Soleimani had their enemies from within as well as without. This has generated extraordinary conspiracy theories across the region – that they may have been betrayed by one of their own. According to one report, when the plane carrying the two generals arrived at Baghdad airport, they were met by three convoys. Two groups of decoy cars set off – fearing a land ambush en route, but the Americans knew to hit the third group. Airport staff at Baghdad and in Syria have been rounded up.

Both men had directed the Hezbollah militia campaigns for over 35 years. They were innovators and improvisers and had a deadly eye for their enemies’ weaknesses. Both had charisma and an originality that their chosen deputies lack. Though of limited formal education, Qassem Soleimani spoke Arabic almost without flaw; and al-Muhandis was the bilingual son of an Iraqi father and Iranian mother.

The biggest challenge for Iran, tactical, strategic and maybe existential, comes from elsewhere. It is Donald J Trump, the genius of anti-strategy. Friends and foes alike are bewildered, astonished, fearful even, at his methods of analysis and decision – or lack of them. According to one report of the briefing at Mar-a-Lago by Defence Secretary Mark Esper about the Iraq options after the attack on the Baghdad embassy, the scene shifted from comedy to black farce. In a slide presentation, the option of taking out Soleimani was mentioned as an afterthought, suggesting this was the very worst resolution, so all the other proposals would be better.

The president went for it.

Intelligence officers have admitted frank astonishment. You could almost hear the shoulders shrugging from across the Atlantic. It was if the protocols of operational planning and execution didn’t exist. For naught were the steps of generating a mission statement, assessing allied and opposing forces, and the subsequent gradations of second and third line strategic consequences.

A day later the chief of staff to the defence secretary, Eric Chewning, said he was quitting and would be gone back to civvy street by the end of the month.

“The Iranians are in a panic. They don’t know what’s coming next, and what Trump will do next,” a well-placed Iraqi business source said this week. “They haven’t come across anything like it before. Iran downs a big US drone – a Global Hawk, the size of a Boeing 737 –, seizes ships in the Gulf, attacks Saudi oil terminals in the desert, and Trump does nothing.

“Then we have the rockets this week, and the protests at the embassy in Baghdad, which weren’t as bad as they first appeared. And suddenly he acts, and does this, a really big hit, which many see as an over-reaction. As we say, he’s thrown a big loop for the Iranians. They’re scared.”