It has been a worrisome few weeks for Iran. The negotiations with world powers over its nuclear program are seeing significant differences, there is chaos in Iraq to Iran’s west, and more recently, the political transition in its eastern neighbor, Afghanistan, hit a serious bump with allegations of fraud threatening to derail the process.

The presidential election stalemate has now been temporarily resolved with both candidates - Abdullah Abdullah and Ashraf Ghani Ahmadzai - agreeing to a “comprehensive audit.” However, the second more crucial aspect of this agreement, the formation of a “national unity government,” remains ambiguous at best. This lack of definition has left room for different interpretations.

Any uncertainty in Afghanistan’s political transition does not bode well for the country’s future stability, especially on the eve of the American withdrawal. At this juncture, no other country could be more worried about what goes on in Kabul than Iran, perhaps even more so than the United States.

Secretary of State John Kerry’s intervention, which ultimately helped clinch the deal in Kabul, received only a murmur of resistance in Tehran. The Iranian Ministry of Foreign Affairs made no comment on the development in its media briefing this week and instead condemned the bombing in eastern Afghanistan, which killed forty.

At her briefing the week before, the Foreign Ministry’s spokesperson, Marziyeh Afkham, stressed that the future of Afghanistan depends on the formation of “an all-inclusive government.” The Iranian administration, as it has done in the past, reiterated its “support for any candidate” who was declared Afghanistan’s new president. Iran’s Deputy Foreign Minister for Asia and Pacific Affairs Ebrahim Rahimpour also conveyed the same in a meeting with Afghan President Hamid Karzai - Iran favors no candidate and “whoever wins is the internal matter of Afghanistan.”

Iran’s Interests in Afghanistan

An often ignored neighbor, Iran has a lot at stake in Afghanistan. For starters, the country, unlike the United States, cannot afford an “exit” from the region. This makes Afghanistan’s future stability ever more critical to Tehran’s strategy for its immediate neighborhood in the short term.

Iran pledged over $900 million in aid to Afghanistan between 2002 and 2013. It spent over half of that amount on infrastructure projects in western Afghanistan that feed into Iran’s regional integration strategy, particularly in the border province of Herat. The protection of its financial assets and personnel engaged in commerce and trade is another priority for Tehran. Almost fifty percent of Afghanistan’s oil imports are provided by Iran and trade between the two countries has doubled in recent years to over$2 billion, with Afghanistan accounting for 45 percent of Iran’s exports.

The countries’ centuries of interactions have produced deeply entrenched political, economic, religious, ethnic, and cultural influences that have proved very useful to Iran in recent decades - particularly during Afghanistan’s inflection points such as the Soviet invasion of 1979, the fight against the Taliban through the 1990s, and the group’s ultimate ouster in 2001.

Through the span of the Soviet invasion, Iran focused on creating what scholar Mohsen Milani labels, an “ideological sphere of influence” in Afghanistan using Shiite and non-Pashtun (Tajik, Uzbek) groups that were based in the country’s north.

The 1990s were spent consolidating these “Northern Alliance” forces into powerful political players who eventually formed the government in 1992 under a power-sharing agreement. But before the Iranians could savor this victory, ethnic rivalries between the warlords dragged Kabul into a civil war and eventually gave way to the Taliban’s rise. When the United States intervened in Afghanistan to overthrow the Taliban in 2001, Iran provided much needed ground support to the US through the very same Northern Alliance.

Since then, Tehran has worked to first, preserve its former relationships with key political players - Shia and non-Pashtun - and second, pragmatically forge new ones with anti-Taliban Pashtun leaders. Iran is constantly acccused of “meddling” by the West, but when it comes to Afghanistan, it has neither resisted a Pashtun president nor emphasized candidates from minority communities. It repeatedly demonstrated this in the 2001 Bonn negotiations as well as the 2004 and 2009 elections. The Iranians do not object as the Tajik and Hazara minorities are satisfactorily represented in the Afghan cabinet.

Abdullah or Ghani?

Notwithstanding the current situation, how would a new president, be it Abdullah Abdullah or Ashraf Ghani Ahmadzai, impact Kabul’s ties with Tehran?

Abdullah, previously the presidential frontrunner and long-time leading opposition figure, has good relations with Iran and a win could help boost its role in the country. A former aide to Northern Alliance commander Ahmad Shah Massoud, Abdullah commands support among minority Tajiks (the late Massoud had a chequered history with the Iranians and engaged both Iran and Pakistan to meet his needs). Iran was quick to condemn an attempt on Abdullah’s life in June.

In the run up to the first round of elections, Abdullah was instrumental in bringing together other pro-Iranian former warlords including Ismail Khan, an old Iranian hand with a power base in the border province of Herat, which is the heart of Iran’s influence in Afghanistan. This list also included parliamentary candidates such as Mohammad Yunus Qanooni, an ethnic Tajik and recently installed vice president; and Mohammad Mohaqiq, leader of the Shia Hazara community and founder of the People’s Islamic Unity Party of Afghanistan. Mohaqiq is also Abdullah’s second vice-presidential candidate.

When it comes to Ghani’s relations with Iran, there is little in comparison. This former finance minister of Pashtun ethnicity has remained too closely associated with the West for Iran’s comfort. On his part, Ghani has over the years maintained a cautious distance from Iran. His presidency may not freeze out Tehran but it won’t exactly prioritize its interests either.

The Waiting Game

Iran’s political clout in Kabul will continue to prove beneficial to Tehran but there has been open pushback against its rising influence in recent years. Sections of the Afghan public and its media haveaccused the Iranian government of funding Afghan provincial council members. Protests targeting its consulate in Herat are on the rise with even the provincial governor Said Fazilullah Wahidi mincing no words about the “unfriendliness of Iran.”There was even some outrage when one of Abdullah’s vice presidential candidates paid tribute to the leader of the Iranian revolution, Ayatollah Ruhullah Khomeini, on the 25th anniversary of his death.

Given all of the above, Tehran may opt to keep a low profile and conduct its politics with greater restraint. Interestingly, Iran and the United States are on the same page regarding the election - a policy of “no favorites” with support for transparency in the election audit process. Ideally, this would be followed by the formation of an all-inclusive or unity government.

For now, Tehran is playing the waiting game in Afghanistan. With the country battling a “terrifying” threat in Iraq and its economic future hinging on an increasingly elusive nuclear deal, Iran cautiously hopes the Afghan political transition will resolve itself and not upset its calculations to the east as well.

- Sumitha Narayanan Kutty is a foreign affairs analyst and journalist specializing in Iran and South Asia. Her articles have appeared in The Washington Quarterly, Al-Monitor, Asia Policy, and the Georgetown Journal of International Affairs. She previously worked in reputed broadcast and new media firms in India and is currently a columnist for The News Minute. Sumitha holds an M.A. in Security Studies from Georgetown University’s School of Foreign Service, Washington DC and a post-graduate diploma in broadcast journalism from the Asian College of Journalism (ACJ), India. Find her on Twitter.