PHOTO: Iraqi Prime Minister Maliki and Iranian President Rouhani, December 2013

In the immediate aftermath of the lighting insurgent offensive in June, Iran gave its firm backing to Iraqi Prime Minister Nuri al-Maliki, even as the Supreme Leader — overruling President Rouhani — said there would be no cooperation with the US in turning back the threat of the Islamic State. Tehran supplied military advisors, including the head of the elite Qods Force, and troops to help Iraqi forces, while proclaiming its defense of Iraqi unity and stability.

However, by mid-July, Iran had modified its stance to say that — while it was still staunch in support of the Iraqi Government — Maliki did not necessarily have to remain as Prime Minister. And then last week, it applied one of the political death blows to Maliki, saying that he should leave power in favor of replacement Haidar al-Abadi.

But how exactly did Iran make its shift? And why?

Writing for Al Monitor, Ali Hashem draws on his Iranian sources to offer details that complement EA’s coverage.

In the third week of July, Iran sent the Secretary of the National Security Council, Admiral Ali Shamkhani, to Iraq for meetings with high-level officials in Baghdad and the Iraqi Kurdistan capital of Erbil. During and after the discussions, Tehran revised its line: 1) Iraq must remain “united” — in other words, Kurdistan must not declare independence; and 2) while backing the Shia-led Government in Baghdad, the Islamic Republic would not insist that Maliki lead it.

It was at the end of July, however, that the most important encounter took place. During his talks in Iraq, Shamkhani had discussed the situation Iraq’s leading Shia cleric, Ayatollah Ali Sistani, in Najaf. Now “an envoy representing the Iranian leadership” visited the cleric.

Within days of the insurgent offensive in June, Sistani had dropped his traditional stance of non-intervention in politics. He said through Friday Prayer spokesmen that all Iraqis — Shia, Sunni, and Kurd — should support the Iraqi defense forces in repelling the threat, led by the Islamic State. Then, as Parliament failed to name the new leader of a Government, Sistani used the Friday Prayer leaders to call for a strong Government as soon as possible.

In his conversation with the Iranian envoy, Sistani went farther: that strong Government should not be led by Maliki.

Sistani’s declaration shook Tehran, already unsettled by the failure to push back the insurgency and by the prospect of US intervention in Kurdistan. So the Supreme Leader asked his aides to convince Maliki to withdraw his bid for a third term. They set out “several alternatives”, including the compromise that the Prime Minister be appointed as Vice President; Maliki flatly rejected all of them.

Iran was ready to jettison Maliki, but it faced a problem: who would replace him? Key figures in the regime favored Ibrahim Jaafari, Prime Minister from 2005 to 2006, but others worried that he could not reconcile the Shia Government with the Sunnis and Kurds.

The solution came more than a week ago from a senior figure in Iraq’s Dawa Party, to which Maliki belonged but also those who might succeed him. The emissary suggested the name of Deputy Speaker of Parliament Haidar al-Abadi.

Up to that time, al-Abadi was little-known in the context of the Prime Ministerial dispute, overshadowed by politicians like Jaafari, Adel Abdul-Mahdi, Ahmad Chalabi, Qusay al-Suhail, and Tarek Najem. However, after Tehran’s acceptance of “a name that wouldn’t intimidate the Sunnis and the Kurds”, the Deputy Speaker emerged as the choice of the National Alliance of Shia parties.

But how will al-Abadi work with Iran, as Tehran fears the US intervention in Kurdistan has shifted the political and military balance in Iraq? That part of the story remains to be told.