Supreme Leader Ayatollah Ali Khamenei has said Iran strongly opposes any foreign intervention in Syria's conflict and will defend Damascus so it can continue "resistance" against Israel, his official website reported on Thursday.
The Islamic Republic supported popular uprisings in Egypt, Libya and Yemen last year but has steadfastly supported Syrian President Bashar al-Assad against a year-old uprising. Assad is a rare ally for Iran in an Arab world largely suspicious of Iranian ambitions for greater regional clout.
In contrast, Erdogan has urged Assad to step down and has allowed opposition groups to meet in Istanbul.
"Iran will defend Syria because it supports its policy of resistance against the Zionist regime (Israel), and is strongly opposed to any interference by foreign forces in Syria's internal affairs," Khamenei was quoted as saying.
He voiced support for reforms announced by Assad and opposed "any plan created by Americans for the Syrian issue."
"America accepts no nation as an independent one ... and this should be taken into consideration in the decision-making of Islamic countries."
Syria has harboured Palestinian militants hostile to the Jewish state and long seen itself as a front-line Arab opponent of Israel, but the two countries have not fought since a ceasefire that ended the 1973 Arab-Israeli war. Israel captured Syria's Golan Heights in a 1967 war.
On Wednesday, Iranian Foreign Minister Ali Akbar Salehi said Tehran backed a U.N.-sponsored peace plan for Syria that calls for the withdrawal from rebellious cities of government troops but does not demand the removal of Assad.
The Iranian authorities have tempered their rhetoric on Syria since anti-government demonstrations began in Damascus in March last year. At first, they wholeheartedly supported Assad but have increasingly encouraged him to pursue social and political reforms to take account of popular grievances.
Earlier in the day Erdogan met Iranian President Mahmoud Ahmadinejad to discuss Iran's nuclear program, which the West suspects is being used to covertly develop atomic weapons. Iran has repeatedly denied such accusations.
"The Turkish government and nation have always clearly supported Iran's nuclear program and will seriously follow the same policy in the future," Iranian state television quoted Erdogan as saying.
Erdogan's visit to Iran touched on economic cooperation. Trade between the two states rocketed to $16 billion last year.
Iran is keen to build further trade relations to minimise tough new sanctions imposed by the United States and European Union on its financial and oil sectors to try to get Tehran to shelve sensitive nuclear activity.
Turkish officials hope trade can reach $35 billion by 2015 and the two countries have agreed to appoint mutual special envoys to study how to expand relations.