State-run media outlets in both China and Iran touted Iranian President Ebrahim Raisi's visit to Beijing last week as fruitful and a sign of the two countries' steady "historic" alliance, but many observers say the trip came at a moment of tension between the two recently distanced countries.
Raisi's visit was his first state visit to China, during which 20 agreements and Memoranda of Understanding (MOUs) were signed.
The hardline Mashregh News quoted Mohammad Marandi, an Iranian Foreign Ministry-affiliated analyst, as saying that relations with China "will remain a main priority for Iran".
"Iran is a very reliable partner for all its friends, and China will increasingly need this partnership" in view of growing US-China tensions, he said.
In March 2021, Iran and China signed a 25-year "strategic co-operation pact" that drew sharp Iranian domestic criticism as foes of the deal accused the regime of "selling Iran".
Despite the pact, China's investment in Iran has decreased, making Russia the biggest foreign investor in the country.
Ali Fekri, Iranian deputy economy minister, said on January 29 that China "invested only $185 million in 25 projects in Iran" between March 2022 and the end of January.
In the two preceding years, Beijing invested $227 million in Iran annually.
Hence, the exchange of visits between Raisi and Xi is seen as an effort to mend the rift between the two countries, observers say.
Iran, China at odds
Other than decreased investment, Tehran and Beijing have recently been at odds over several issues, including China's rapprochement with Gulf states.
In December, the Iranian Foreign Ministry expressed discontent to the Chinese ambassador in Tehran after Beijing issued a joint statement with the United Arab Emirates (UAE) on three disputed islands -- Abu Musa, the Greater Tunb and the Lesser Tunb -- siding with the UAE over Iran.
The statement was issued during Xi's visit to Saudi Arabia, where he met with leaders of Gulf Co-operation Council (GCC) states.
In the statement, China also agreed with the need for Iran to stop its interference in the region.
On the heels of the GCC meeting, reports were published on China's decreased investments in Iran. In contrast, China is presently Saudi Arabia's largest trade partner and the largest buyer of its oil.
Recent news that China hacked Iran's Foreign Ministry and other key official entities further eroded relations between the two nations.
China's actions are certainly against Iran's self-proclaimed political and geopolitical principles, but being isolated from most of the world, the Islamic Republic does not appear to have many alternatives, some analysts say.
The recent tension was evident even in Raisi's remarks during his visit.
"Iran and China's relations have moved forward, but what has been done is far from what should have been done, and more steps should be taken to compensate," he said.
Raisi praised the Chinese president's "innovative" Belt and Road Initiative (BRI), or One Belt, One Road (OBOR), adding that Iran is prepared to take action in this regard.
"The invitation Xi has extended to Raisi might be Beijing's way of keeping its friendship with Iran after having recently alienated it," said an Iran-based political observer who wished to remain anonymous.
"China does not want to lose Iran as a strategic partner and a cash cow," he told Al-Mashareq.
"China wants to have both the Arab countries and Iran in its corner, and is using the most deception when it comes to Iran," he added.
Iran intends to pursue its expansionist and destabilising policies in the region, as well as its illegitimate nuclear activities, both of which have caused its isolation from the global community, the political observer said.
"As Iran is adamant about continuing on its path and remaining isolated from the world, it is also adamant about keeping its relations with the countries it has pacts with."
"Tehran is so isolated and broke that it would throw any principle to the wind in search of a friend, even if the friend has proven to be a foe at times," he said.