They are home to more than a million of Iraq’s Shia Muslims, and contain the tombs of that faith’s holiest figures. In recent months they have provided thousands of fighters for the militias battling Isis, but their inhabitants have watched in frustration as US air power has been deployed in support of the less effective Iraqi army.

On 15 July though, in the cities of Najaf and Karbala there was a sense that the nuclear deal struck on 14 July between neighbouring Iran, the world’s leading Shia nation, and the West may yet lead to closer US support for the Shia militias as they try to dislodge their Sunni jihadist foes from captured Iraqi cities.

“American air attacks are playing a role in the battle for Fallujah,” a divisional commander of the Iraqi paramilitary militia admitted grudgingly, though he also listed the occasions when the US had failed to support Shia forces in previous battles against Isis.

The parallel but distinct wars against Isis pursued by the US and Iran in Iraq were converging even before the accord. Over the last year, the Iranians have mostly supported the militia forces, while the US air campaign and training has focused on backing the regular Iraqi army and the Kurdish peshmerga.

Shia religious leaders in Najaf and Karbala, whose shrines are venerated by Shia across the world, are uncertain what the nuclear accord will mean in practice. But some believe it will lead to greater military co-operation between the US and Iran against Isis. “It shows that diplomacy can work,” said one senior clergyman in Najaf. “Now we need everybody to unite to destroy Isis as a threat to the whole world.”

The capture of Ramadi by Isis on 17 May means that the Baghdad government now depends heavily on the Shia Hashd al-Shaabi, or popular mobilisation units. Sheikh Karim Abdul Hussain, the commander of the 8,400-strong Imam Ali division of five brigades from Najaf, puts the militias’ military strength at 120,000 men. He would not comment on how much impact any measure of détente between Iran and the US would have on the war.

A senior Shia clergyman called for the US to supply Iraq with modern weapons and to put pressure on Saudi Arabia, Turkey and Qatar to stop providing covert military aid to Isis, and to rebel groups in Syria affiliated to al-Qaeda. Another demand of the Shia religious leaders is that neighbouring countries, notably Turkey, close their borders to volunteer fighters crossing into Iraq and Syria to join Isis.

Grand Ayatollah Ali al-Sistani and the senior Shia clergy, based in Najaf and Karbala, have always been influential in Iraqi politics. Two-thirds of Iraq’s 33 million population are Shia. But Iraqi government corruption, and its failure stop Isis taking control of a third of the country, has discredited Iraqi politicians, including the Prime Minister, Haider al-Abadi. The Iraqi army disintegrated in humiliating circumstances when it lost Mosul in June last year and was similarly defeated in Ramadi this May.

ORDER IT NOW

This puts the senior Shia clergy at the heart of the Iraqi war effort. The Hashd militia was created after Isis captured Mosul, when Sistani issued a fatwa calling for people to join military formations to fight Isis. The religious leaders say their call was to defend Iraq, not to set up sectarian Shia militia. However, the Hashd is overwhelmingly Shia and far outnumbers the combat-ready strength of the Iraqi army, said by one Baghdad security official to number between 10,000 and 12,000 men.

The number of Hashd casualties is not known, but their training period is often as little as 25 days, leading to unnecessary losses, some say. Black banners with the names of those killed in the war are fastened to walls in prominent places, such as at crossroads, in Karbala.

The outcome of these battles against Isis in central Iraq may be affected by even a limited rapprochement between Iran and the US. It could mean that the US would conduct air strikes in support of military action by the Hashd – nominally under the authority of the Iraqi Prime Minister and his national security adviser, Faleh al-Fayadh, and answerable to the defence ministry on operational matters.

In reality, Iranian control is predominant in only three of the main milita units. “Would it surprise you to know that there are more American advisers in Iraq today than there are Iranian advisers?” said a senior cleric in Karbala, who played down Iranian influence. He added that Ramadi had only fallen because the Iraqi government, under pressure from the US and Sunni politicians, had rejected an offer of help from the Hashd.

Overall, the nuclear accord may not immediately translate into wide-ranging co-operation between Iran and US against Isis. But over time it may encourage the US to do business with Iran’s allies – the Shia militias in Iraq and the Syrian army in Syria – if it is to stop Isis winning more victories.

Shia clerical leaders are cautious, but they hope the US will no longer automatically support the approach of Sunni states like Saudi Arabia and Qatar – its traditional allies, which have backed the Sunni-dominated rebels in Syria.