Putin has been careful to choreograph his Iraqi reset with an eye to not upsetting his ties with Iran. It was no surprise that as the Iraqi crisis was unfolding, the Kremlin announced that Putin will visit Tehran on Nov. 1 for a trilateral summit with Iranian President Hassan Rouhani and Azerbaijani President Ilham Aliyev. But the talks that matter, we surmise, will focus on Iraq and Syria.

And Russia has indeed pivoted to Baghdad, and the Iran-Turkey alignment, to keep pace with events. Iraq and Russia seem on the verge of an agreement that would expand bilateral economic and security ties, including possible arms sales, and that, from an energy perspective, Russia will seek to lessen its exposure in the north and make clear it is ready to do oil and gas deals with Baghdad. Iraq, signaling a new chapter in the Iraqi oil industry, has already invited BP to develop the reclaimed oil fields around Kirkuk. Chevron has suspended operations in Iraqi Kurdistan.

This Week in Review column wrote Oct. 1, as the crisis over the Iraqi referendum was unfolding, that Putin was boxed in in Iraq, with much at risk, but was not without options. “If he misplays his hand in northern Iraq by banking on a weakened Barzani, he may end up finding himself exposed and on defense in both Syria and Iraq, and at odds with Iran and Turkey — the worst of all worlds,” we suggested. “Or he can tactfully shift toward the Iran-Turkey alignment, which is gaining traction and strength, quietly distancing himself from dependence on Barzani while opening discussions with Baghdad to pursue Russia’s energy interests in northern Iraq.”

Putin had been banking on the Iraqi Kurdistan Regional Government to expand Russia’s regional influence and energy assets. Rosneft, the Russian energy company, had made a roughly $4 billion investment in the region’s energy sector. What Putin did not bank on was that Iraqi Kurdistan President Massoud Barzani, despite warnings from all quarters, would proceed with a disastrous independence referendum that led to the Iraqi central government reclaiming Kirkuk and disputed territories in what Cengiz Candar has labeled the worst setback for Iraqi Kurds since 1975, when the Kurdistan Democratic Party lost the support of Iran and was crushed by Saddam Hussein’s forces.

Russian President Vladimir Putin has moved quickly to adapt to the Iraqi federal government’s retaking of Kirkuk and disputed territories through the use of Iraqi forces, all the while seeking to limit any fallout with Iran in Iraq and Syria.

We wrote in August that the emerging Turkish-Iranian alignment would test “the limits and extent of Moscow’s influence among the regional players,” and that Putin, especially in the absence of an improvement in US-Russia ties, would seek to accommodate and work through this axis. In Iraq, where Russian influence until now has been thin, he has had no choice.

Putin is also leveraging his ties with both Israel and Iran to avoid a conflict in Syria. Maxim Suchkov writes that Iran was at the top of Russian Defense Minister Sergie Shoigu’s agenda during his meetings in Israel on Oct. 16-17. Shoigu “provided some information on the way the four de-escalation zones in Syria will function. Israel opposes the idea of Iran being one of the intermediaries in the process, but Russia is set to maintain the current framework.”

Ben Caspit reports that the Syrian firing of an anti-aircraft missile Oct. 16, the day Shoigu arrived in Israel, may be a catalyst for a “redefinition” of Israel’s rules of engagement in Syria. “In the course of the talks with Shoigu,” Caspit writes, “the subject of growing Iranian influence in Syria also came up and was discussed in detail. According to sources, Liberman said that Israel will not accept an Iranian presence on its borders. That is a casus belli and a clear red line. Netanyahu said the same thing to the Russian general.”

“Russia’s support for Hezbollah has also been on the agenda for the two parties,” Suchkov adds, “with the Russians supposedly assuring the Israelis that their dealings with the group don't go beyond targeted planning of certain operations in Syria and that Moscow doesn’t supply it with arms. … Given Israel's role in the region, its military power and its willingness to use it, it is critical for Putin to continue the current level of communication with Netanyahu to ensure Russia’s own presence is immune from any Israeli assaults."

Suchkov concludes, “At the same time, Tehran is resolved to expand and solidify its presence. Moscow doesn’t see that situation as its own fight and is working to dodge potential complications of ending up on either side. Israel has been rather loyal to Russia’s military presence — and realizes its own gains from it — and Iran has been crucial to Russia on the ground in Syria. But Russia's goals in Syria aren’t ultimately about either Israel or Iran. Moscow is, however, wary of each party trying to work Russia’s presence to the detriment of the other.”

As Russia has been adapting to the shifting regional situation after Kirkuk, the Trump administration appears to be in reverse because of its zero-sum view of Iranian behavior.

US national security adviser Gen. H.R. McMaster’s vision of a “stable Iraq that is not aligned with Iran,” on Oct. 19, as reported by Laura Rozen, seems more aspiration than reality, and may prevent Washington from the cleared-eyed analysis and strategy needed to keep pace with Iran, and now Russia, in Iraq.

There was of course a time when Iraq was not aligned with Iran, but the United States ended that era by taking out Saddam Hussein in 2003. Then there were the Iraqi parliamentary elections of 2010, where a plurality was won by the bloc led by Ayad Alawi, a secular nationalist who opposed Iranian influence in Iraq. However, the Americans were outmaneuvered by Iran, including Islamic Revolutionary Guard Corps' Quds Force leader Qasem Soleimani, who also made sure that the Iraqi parliament did not agree to a US status of forces agreement. The United States eventually asked Alawi to give up the political fight, and Nouri al-Maliki, a more sectarian politician who had made his peace with Iran, took over as prime minister.

When the Islamic State (IS) took large swaths of Iraqi territory in 2014, Iran, like the United States, was there to help, not just in Baghdad, but in Iraqi Kurdistan. The formidable Popular Mobilization Units (PMU) — some backed by Iran, with others aligned with Iraqi clerical and militia leaders — made their bones, along with Iraqi federal security forces, in the battle against IS since 2014. Some of the PMU agendas may be more sectarian than national but, as one might miss from the Iran hype in Washington these days, the PMU forces are Iraqis, not Iranians, who command considerable respect and influence.

Iraqi Prime Minister Haider al-Abadi, for his part, is an Iraqi nationalist who just scored a major win in the eyes of most Iraqi Arabs by retaking Kirkuk and most of the disputed territories without massive bloodshed. He is speaking the language of the Iraqi Constitution and reconciliation — not ethnic score settling.

Given the outcome, one might wonder if Abadi would agree that Iran’s intervention was “subverting Iraq,” as McMaster claims, or rather helping the Iraqi government in its effort to restore sovereignty. There is, or perhaps should be, “some nuance to the US position,” as Rozen writes. The United States, like Iran, opposed the Iraqi Kurdistan independence referendum for much the same reasons. The United States wanted to avoid a major military escalation in Kirkuk, which Abadi, with Iranian help, was able to pull off.

A little nuance and realism might better serve the US posture than the now well-worn administration talkers about how each and every Iranian action is a threat to regional and world peace (or so it seems these days). Abadi is no Iranian proxy, but his interests are in a constructive friendly relationship with an influential and powerful neighbor. That relationship paid off last week. Abadi also knows he needs the United States, including to counter Iranian overreach. US military support, more than Iran’s, was decisive in taking back his country from IS. Washington, rather than Tehran, will be essential in helping broker reconciliation with Iraq’s still disenfranchised Sunni community. Iran has no credibility in this enterprise. US efforts to help reconcile Iraq and Saudi Arabia, as Rozen reports, are giant steps toward postwar stabilization.

But Abadi has no interest in making Iraq a battlefield between the United States and Iran, and Washington would be well-served to keep that in mind. A zero-sum approach to Iran in Iraq is a likely loser for both the United States and Iraq, and a windfall for Moscow and Tehran.