Sharing a frontier with both Armenia and Azerbaijan as they fight a bitter war over the breakaway Nagorno-Karabakh territory, Tehran is closely watching the conflict amid growing concern it could spill over the border.
A number of artillery shells and rockets have recently landed in Iranian territory, including a residential area, only kilometers away from the battle zone, Iranian officials and media have reported.
Tehran is playing a delicate balancing act between its two neighbors, taking an official neutral stance while calling for an end to the hostilities and a dialogue between the countries despite strong domestic pressure for the Islamic republic to fully support Azerbaijan.
Tehran has assured Azerbaijan that it recognizes its territorial integrity -- the ethnic-Armenian-controlled Nagorno-Karabakh is internationally recognized as Azerbaijani land -- and has also denied as "baseless rumors" reports claiming that it was assisting Armenia, which has traditionally shared strong ties with Tehran.
"We have very good relations with both nations," Iranian President Hassan Rohani said on October 7, referring to Azerbaijan as a brother nation and Armenia as a neighbor. "The war should come to an end. We hope stability returns to the region."
An offer to mediate, expressions of concern, and visits by officials to the border region highlight Tehran's growing concern over the fighting, which Rohani warned on October 7 could turn into a regional war.
A wider conflict could have unpredictable consequences for the Islamic republic, which has been working to keep its borders secure while engaging in proxy wars across the region.
"We won't allow in all these years that we have been fighting -- [assassinated commander of the Islamic Revolutionary Guards Corps elite Quds force Qasem] Soleimani has been…fighting to eradicate terrorists there so that they don't come near our borders," Rohani said earlier this week.
"Some are trying to bring terrorists from Syria to locations near [Iran's] borders," Rohani said, an apparent reference to reports that Turkey had recruited Islamist fighters to go to Azerbaijan and help in the war.
"It is unacceptable," said Rohani, refraining from naming any specific country.
French President Emmanuel Macron has specifically accused Ankara of sending "Syrian fighters from Jihadist groups" to fight in Nagorno-Karabakh amid concerns that Turkey, a close ally of Azerbaijan, and Russia, which has a military base in Armenia, could be pitted against each other.
The two countries have backed different warring sides in Syria -- where Iran has been propping up the regime of Syrian President Bashar al-Assad -- as well as in Libya.
Touraj Atabaki, professor emeritus and chairman of the Social History of the Middle East and Central Asia at Leiden University, said that, for Iran, the growing presence in the region of its chief enemy, Israel, is a major source of concern.
Israel is a major arms supplier to Azerbaijan, according to the Stockholm International Peace Research Institute (SIPRI).
Azerbaijan has acknowledged using Israeli-made attack drones -- or "kamikaze drones" --- during the recent fighting with Armenian forces.
"The presence of Israel, although implicitly is a cause of concern for Iran, we see [Israel's] shadow in the war over Nagorno-Karabakh, therefore the Islamic republic wants to see an end to this conflict as soon as possible,"Atabaki told RFE/RL.
"The Islamic republic fears the consequences of a war, which could turn into a proxy conflict and Tehran could be dragged into it," he said.
Speaking to the daily Hamshahri, Seyed Ali Saghaian, a former Iranian ambassador to Armenia, said the main reason for the current conflict are "third-party elements, particularly the Zionist regime," a term used by Iranian officials to refer to Israel.
"Regional and transregional third-party elements are seeking influence and have prevented the resolution of the crisis," Saghaian said.
With a large Azeri minority of an estimated 20 million -- as well as over 100,000 Armenians -- living in the country, Tehran is also wary of ethnic and social tensions at a time of economic crisis caused by crippling U.S. sanctions and state mismanagement that have caused widespread public dissatisfaction.
Protests In Several Cities
Earlier this week protests were reported in several Iranian cities -- including the capital, Tehran, and the northwestern city of Tabriz -- in support of Azerbaijan.
The protests came as four representatives of Iranian Supreme Leader Ayatollah Ali Khamenei -- who is an ethnic Azeri -- in four of the country's provinces with a large ethnic Azeri populations released a joint statement in support of Baku.
The statement by Khamenei's representatives in the provinces of West and East Azerbaijan, Ardebil, and Zanjan said that "there is no doubt" that the breakaway region belongs to Azerbaijan.
Meanwhile, Ali Akbar Velayati, a top adviser to Khamenei, accused Armenia of "occupying" Nagorno-Karabakh while calling on Yerevan to withdraw its forces.
"We call on Armenia to return those occupied parts to the Republic of Azerbaijan," Velayati said in an October 6 interview with the hard-line daily Kayhan.
"More than 1 million [Azerbaijanis] have been displaced after the occupation of those areas and must return home soon," he added.
A day later, government spokesman Ali Rabei urged Armenia to pull its forces from Nagorno-Karabakh while reiterating Iran's stance that the conflict does not have a military solution.
"We want peace and dialogue in the region, with an evacuation from occupied territories and respect for Azerbaijan's territorial integrity," he said.