A key aide to Iran's supreme leader said on Saturday Turkey must radically rethink its policies on Syria, the NATO missile shield and promoting Muslim secularism in the Arab world -- or face trouble from its own people and neighbours.
In an interview with the semi-official Mehr news agency, Ayatollah Ali Khamenei's military adviser described Prime Minister Tayyip Erdogan's invitation to Arab countries to adopt Turkish-style democracy as "unexpected and unimaginable".
Turkey and Iran, the Middle East's two major non-Arab Muslim states, are vying for influence in the Arab world as it goes through the biggest shake-up since the Ottoman Empire fell, a rivalry that has strained their previously close relations.
While cheering crowds greeted Erdogan on his recent tour of North Africa, Tehran accused him of serving US interests by opposing Syrian President Bashar al-Assad's crackdown on street protests and agreeing to NATO's missile defence.
"The behaviour of Turkish statesmen towards Syria and Iran is wrong and, I believe, they are acting in line with the goals of America," Major-General Yahya Rahim-Safavi told Mehr.
"If Turkey does not distance itself from this unconventional political behaviour it will have both the Turkish people turning away from it domestically and the neighbouring countries of Syria, Iraq and Iran (reassessing) their political ties."
Khamenei has dubbed the Arab uprisings an "Islamic awakening", predicting peoples in the Middle East that have overthrown dictatorial, Western-backed regimes will follow the path Iran took after its 1979 Islamic revolution.
The uprisings have been generally secular in nature, analysts say.
Erdogan's advocacy of secular Muslim democracy -- which he extolled during his tour of Egypt, Tunisia and Libya last month -- is far from the message the Islamic Republic of Iran wants spread in the region.
"I think the Turks are treading a wrong path. It might very well be that the path was set for them by the Americans," said Rahim-Safavi.
"The Turks have so far committed a few strategic wrongs. One was Erdogan's trip to Egypt and his presentation of the secular model there. This fact was unexpected and unimaginable since the Egyptian people are Muslims."
While Tehran has publicly urged its close ally Syria to listen to people's legitimate demands, Erdogan has predicted Assad will be ousted "sooner or later" and is set to impose sanctions on Damascus despite a veto on U.N. action by Russia and China.
But it is Turkey's decision to deploy a NATO missile early warning system that has most angered Tehran, which sees this as a US ploy to protect Israel from any counter-attack should the Jewish state target Iran's nuclear facilities.
Rahim-Safavi said trade ties with Turkey -- which is an importer of Iranian gas and exporter of an array of manufactured goods -- would be in jeopardy if Ankara does not change tack.
"If Turkish political leaders fail to make their foreign policy and ties with Iran clear, they will run into problems. If, as they claim, they intend to raise the volume of contracts with Iran to the $20 billion mark, they will ultimately have to accommodate Iran."