The historic visit this week of Indian Prime Minister Narendra Modi to Israel could not have been welcome news in Iran.

However, recent comments by Supreme Leader Ayatollah Ali Khamenei regarding the chronic dispute between India and Pakistan over Kashmir have also bolstered those who oppose an expansion of Iran-India relations.

On June 26, the Iranian leader appeared to equate the plight of Muslims in Kashmir with that of Shi’ites oppressed by the governments of Yemen and Bahrain. Khamenei said, “the Muslim world should openly support the people of Yemen, Bahrain, and Kashmir and repudiate oppressors and tyrants who attacked [them].”

There have been several instances in which a speech by Khamenei caused controversy and required later modification by him or his office. Reinterpretations in domestic affairs may be easier. However, in foreign affairs, such comments could be very detrimental to Iran’s national security interests.

Iran and India have historically maintained normal ties. But there have been a number of disappointments and matters of contention, among them: India’s burgeoning relationship with Israel, as demonstrated by the Modi visit; slow Indian development at the Iranian port of Chabahar; the lack of a contract for India develop Iran’s Farzad B gas field; and India’s reduction in Iranian oil imports.

These irritants come in the context of difficult episodes in the past.

In 2006, India voted at the International Atomic Energy Agency to refer Iran’s nuclear program to the UN Security Council. In 2010, India abstained on a UN Human Rights Council resolution about human rights violations in Iran, after voting against such resolutions previously.  Also in 2010, Khamenei, in his message to hajj pilgrims, called on Muslims worldwide to support Kashmiris. “Today, helping the Palestinian nation and those under siege in Gaza, empathy towards the people of Afghanistan, Pakistan, Iraq, and Kashmir, resistance against the American and the Zionist aggression, guarding the unity of Muslims and fighting against the forces that undermine this unity, and expanding the enlightenment and the sense of responsibility among the young Muslims are among the prime responsibilities of the elites of the Muslim nations,” Khamenei said.

In response to the 2010 message, the Indian Government summoned Iran’s envoy to New Delhi and criticized the Supreme Leader’s statements as meddling in India’s internal affairs. The tensions eased only when Prime Minister Manmohan Singh met with Khamenei in August 2012 on the sidelines of a Non-Aligned Movement summit in Tehran.  Khamenei expressed admiration for India and told Singh, “It is important for Iran that India is stable and makes progress.”

Khamenei has generally promoted expansion of India-Iran relations. Meeting in Tehran in May 2016 with Prime Minister Modi, Khamenei welcomed joint Iranian-Indian economic projects and praised India’s  “correct policies” of taking an independent approach toward fighting terrorism rather than joining Arab or US-led coalitions.  Modi in turn stated that a visit Khamenei paid to India in 1980 had “paved the way” for expanding relations.

During that visit, Khamenei, at the time Tehran Friday prayers leader and the representative of then Supreme Leader Ayatollah Ruhollah Khomeini to Iran’s Supreme Council of Defense, paid a 24-hour visit to Kashmir. According to Hossein Razavi, the trip to Kashmir took a week of preparation. Khamenei was welcomed by both Shi’ites and Sunnis, stressed the importance of unity between the sects and even held prayers in a Sunni mosque.

For many decades, Iran, while advocating export of the Islamic revolution, focused mainly on the Palestinian issue and stayed away from disputes such as Kashmir in India and Parachinar in Pakistan.

Parachinar is a city with a large Shi’ite population that has occasionally witnessed massacres of Shi’ites by Sunni militant groups such as Lashkar-e Jhangvi. Despite having a reputation for protecting and actively supporting Shi’ites around the world, Iran avoided active meddling in Pakistan and limited its support of co-religionists there to reminding Pakistani officials of the importance of unity among different religious groups.

Iran has also not taken sides with non-Muslim governments over oppressed Muslim populations when that was perceived as conflicting with more pressing foreign policy concerns. Thus Iran has not intervened in support of Chechens in Russia or Uyghurs in China. So why did Khamenei mention Kashmir now?

The comments appear particularly ill timed, given the Trump administration’s hostility toward Iran and India’s evident desire to strengthen ties with the United States. With Washington moving to impose more sanctions on Iran and to oppose its regional interventions, the last thing Iran needs is to jeopardize ties with a major economic partner in South Asia.

Fatemeh Aman is an expert on the Middle East and South Asia. She has worked as a journalist, media and political analyst, and has written widely in English and Persian on Iran, and South Asia. She is a frequent contributor to Jane’s publications, including Jane’s Islamic Affairs Analyst and Jane’s Intelligence Review, and appears often on Persian and English-speaking media outlets.