Turkey and Iran made a valiant effort to patch up their deep divisions during Turkish Prime Minister Recep Tayyip Erdogan’s visit to Iran last week when he focused on expanding economic cooperation, and was accompanied by his economic and energy ministers. Iran has backed Bashar Al Assad with military and financial support, and the Turks have supported the opposition, outraged at Al Assad’s brutal massacres of his suffering population.

But this enmity did not stop Erdogan from seeking to find new allies to shore up his eroding position in the Middle East. A few years ago his public quarrel with Israeli President Shimon Peres and his active resistance to Israel’s assault on Gaza helped him gain a popular leadership role in the Arab world, but his confused reaction to the Arab Spring and his recent display of autocratic authority greatly weakened Turkey’s position.

Therefore Erdogan tried to grab some advantage from the rapidly changing regional situation when he met Iranian Supreme Leader Ayatollah Ali Khamenei as well as President Hassan Rouhani, who has just launched a charm offensive in the international arena with a keynote speech at Davos. Erdogan used their mutual concern over the rise of Al Qaida in Syria to find common ground, and he then used Iran’s economic opening to its neighbours in the region and to the West to try and build some economic advantage, particularly since Turkey is desperate to have access to Iran’s plentiful supplies of oil and gas.