Turkish President Recep Tayyip Erdogan is visiting the United Arab Emirates, hoping to repair strained ties. Analysts say shared concerns over Iran could provide common ground.

Erdogan said that his two-day visit to the United Arab Emirates, which began Monday, aims to ease years of tension and rivalry with the Persian Gulf state.

He said that with the visit, Turkey aims to develop the momentum it has achieved and to take the necessary steps to bring relations back to the level, he said, they deserve.

Turkey has found itself increasingly isolated across the Middle East, due largely to Ankara’s support of the Muslim Brotherhood Islamist group, something that has caused unease among many Middle Eastern leaders.

Teacher of international relations Soli Ozel at Istanbul’s Kadir Has University says Erdogan’s UAE visit is part of a wider regional reset, with Iran providing crucial common ground.

“Turkey’s charm offensive has targeted several countries, with one of them the United Arab Emirates. Both countries have an interest, along with all the western countries, for Iran not to be so influential as it is today,” he said.

Turkey is increasingly in competition with Iran, from the Caucasus to Syria.

Last week Turkish pro-government media reported several alleged Iranian agents were arrested in Turkey in a joint Turkish-Israeli intelligence service operation to thwart the assassination of a Turkish-Israeli businessman.

The arrests came after Iran recently cut off natural gas supplies to Turkey for more than a week, causing much of the country’s manufacturing sector to shut down for several days.

Asli Aydintasbas, a senior fellow at the European Council, says there are suspicions the gas shut-off may have been politically motivated.

“We’ve seen Iran cut off the natural gas for Turkey ostensibly because [it] had something breaking down or it [Iran] needed it for its internal market. But it’s no coincidence that this happened after a meeting between Vladimir Putin and Iran leader [Ebrahim] Raisi. This was clearly a message to Turkey,” she said.

Iran and Russia are working closely together in Syria in backing the Damascus regime, while Turkey backs Syrian rebels. Moscow has also voiced its anger over Ankara selling armed drones to Ukraine.

Analyst Ozel warns that the Turkish-Iranian rivalry is likely to escalate, with Ankara sharing Western and Middle Eastern countries’ fears over Iran’s nuclear energy program.

“If Turkey wants to jump on board in that struggle, then yes, we can expect Turkish-Iranian relations to be a bit testy. On the other hand, Turkey and Iran manage to have competitive and cooperative relations for centuries, so they are pretty well versed on how to do that,” he said.

If there’s a breakdown in talks between Iran and the international community to resolve concerns over Iran’s nuclear energy program, analysts warn that Turkey’s effort to balance competition and rivalry with its Iranian neighbor could face a greater test.