When Iran was called Persia and Turkey the Ottoman Empire, war was a regular past time for their rulers. Since the Safavid rulers embraced Shi'a Islam in the 16th century, the two countries fought intermittently until 1847, when the second Treaty of Erzurum put an end to their territorial disputes. Still, it took them 67 years to finally demarcate their borders to everyone's agreement.
Recent tensions between Ankara and Tehran are not surprising, then. If anything, their brief honeymoon was unusual.
Iran and Turkey enjoyed a boom in economic trade - facilitated by Iran's needs to find new venues for sanctions busting. Iran looked to Turkey as a friendly mediator on the nuclear issue. Turkey relied on Iran to conduct joint military offensives against the PKK. Finally, the two regimes shared a liking for Hamas, a dislike for Israel and a affinity about political Islam.
But the causes of their temporary friendship are also the root of their enduring rivalry, which the Arab Spring rekindled. Syria lit the fuse - with Ankara unable to stand indifferent to the slaughter ordered by Tehran's proxy dictator in Damascus.
Besides, both Turkey and Iran aspire to export their Islamic model to the region as a way to assert their hegemonic ambitions. Inevitably, as US influence is under threat from the rise of new Islamic regimes, the question is: will they look to Turkey or Iran for help, advice and inspiration? Neither country is, historically, a friend of the Arabs. But it appears that a Sunni Turkey is more palatable than a Shi'a Iran.
And while Iran seeks open confrontation with the West, Turkey just seeks more independence in the way it operates regionally. There are no doubt contradictions in this approach - Turkey believes it can be both a member of Nato and rattle its sabre to Israel, Cyprus and Greece (a Nato ally) over energy resources that Europe sees as vital to its needs and America considers crucial to its strategic interests. But clearly, within this contradiction there is room for the deployment in Turkey of a radar system that is part of the Nato missile defence plan against Iran - and at the same time for the Turkish foreign minister, Ahmet Davutoglu, to declare that Turkey will not allow any country to commit an aggression against Iran from Turkish territory.
As historians are fond of saying, history is not a foreign country. Nothing truer, when it comes to Iran and Turkey.