May 12 is more than the deadline for Donald Trump to withdraw from the Iran nuclear agreement. It’s also the day that Iraqis are due to go to the polls to vote for a new parliament. And while the election has been largely overlooked amid the tension over the US president’s decision, it’s hard to understate the significance of the ballot for Washington and Tehran.Iran is seeking to create a pro-Iranian government in Iraq so Tehran is better placed to hit back at the United States should Trump re-impose sanctions. The defeat of Islamic State in Iraq has been a major victory for US-backed Prime Minister Haider al-Abadi, but Iran is working towards shifting the political balance in its own favor – to force an early exit of US forces, to end the strategic partnership between Iraq and the United States, and to secure Iraq’s support for its regional agenda. Such an outcome would undermine stability in Iraq and would further strengthen Iran in the Middle East at the expense of the United States.Washington’s influence has waned in the region, even as Iran has secured substantial leverage in Syria, Lebanon and to some extent Yemen. Iraq is one country where the United States has made gains. Despite a dramatic loss of influence early in the Obama administration, which was compounded by the withdrawal of US forces in 2011, the United States made a comeback in Iraq in 2014, providing intensive support to defeat Islamic State.As the Iraqi parliamentary elections approach, Iran is intensifying its efforts to cultivate wide-ranging political partnerships in the country. Trump may yet decide to stay in the accord if the European Union manages to identify new sanctions that could satisfy him without endangering the deal. However, the failure to reach an agreement to date raises the likelihood that Trump will end sanctions relief for Tehran.Iran may respond by restarting its nuclear weapons program, but this is a high risk strategy that could prompt Trump’s hardline advisers to pursue air strikes on weapons and research facilities in Iran. To avoid such strikes, Iran may instead seek other ways to hit back.For example, if Iran succeeds in building a loyal political coalition that takes power in Baghdad, that new government could eject US troops from Iraq – something that Iraqi political figures close to Iran have long wanted. As recently as March, a small majority of the Iraqi parliament called on the Iraqi government to set out a timetable for the withdrawal of US troops. The surprising vote by a largely pro-Iranian group of parliamentarians was seen as an effort by Iran to demonstrate its political leverage in Iraq.The proportional representation system that governs Iraq’s elections means there will be no clear winner after the vote. Instead, once the results are announced, several electoral blocs will scramble to build a coalition large enough to take power. The two largest blocs are likely to be Nasr (“Victory”), led by Prime Minister Abadi, and Fatah (“Conquest”), led by pro-Iranian former militia leader Hadi al-Amiri.Iran is seeking to persuade, among others, the major Iraqi Kurdish political parties, the KDP and the PUK, to support Fatah. The Kurdistan Region of Iraq has seen a collapse in its revenues and its political leverage since it lost control of oil-rich Kirkuk and other disputed territories to federal government control following the Kurdish independence referendum last September. Iran is exploiting Kurdish disappointment over the lack of US support over the ballot by offering the Kurds a new political deal with Baghdad that it says Fatah will deliver. Although these efforts are being led by the Iranian Revolutionary Guard Corps, which is responsible for expanding Iran’s networks of influence in the region, other parts of the Iranian government are also supporting this outreach. A high-level Iranian delegation traveled to the Kurdish capital of Erbil this month for a conference designed to bolster trade ties between Iran and the Kurdistan Region of Iraq. The message to the Kurdish parties is clear: the path to economic vitality and political autonomy goes through Tehran, not Washington.If Fatah is able to build momentum in its effort to build a governing coalition, it could quickly attract support from political leaders keen to secure a ministerial position. Iran may even be able to persuade Abadi to form an alliance with Fatah, in a bid to stay on as prime minister. In such a scenario, the Iranians would try to ensure that Abadi is simply a figurehead for a staunchly pro-Iranian government. Abadi briefly joined the Fatah coalition earlier this year, before changing his mind and running a separate electoral coalition.We may even see small Iranian-backed militia groups attempting to attack US troop positions in Iraq. This tactic was widely used by Iran to undermine the United States after the invasion of Iraq, and Iranian-backed militias have occasionally threatened to target US troops since 2014. Asaib Ahl Al-Haq, which is part of the Fatah coalition, threatened to attack US forces engaged in the liberation of Mosul. Directly targeting US troops is a risky strategy, however, that Iran may avoid for fear of retaliation on Iranian soil.The premature withdrawal of US forces from Iraq would halt the critical effort to rebuild Iraq’s security forces. This would enable Iran to strengthen the position of the Popular Mobilization Units, a recently formalized militia force subject to substantial Iranian influence. The continued undermining of Iraq’s national security forces could threaten stability in Iraq’s liberated areas, where local populations often chafe under the control of the Shi’ite-dominated units.Iran may also seek Iraqi support for its regional agenda by strengthening the participation of Iraqi militias in the Syrian civil war, isolating Iraq from the Gulf states, and denying the United States access to a strategic foothold in the region. In these efforts, Iran will face little effective push back from US-aligned regional powers. Although there has been much press coverage of the warming relationship between Iraq and the Gulf States, these new ties are only skin deep. Saudi Arabia, Qatar and the United Arab Emirates have created much fanfare with high level visits, but, unlike Iran, they have not done the painstaking groundwork needed to build relationships of influence across the political spectrum.The United States has made great strides in reviving a neglected political relationship between Baghdad and Washington, and restoring at least superficial relationships between Iraq and the Gulf Cooperation Council states. This rare success story could be undermined by an Iran that sees Iraq as a place where it can strike back.