“The aim of operation Euphrates Shield [the code name of the operation in Syria] is not to target any country or person , but only terrorist organizations,” Erdogan told a gathering of elected village and district heads in Ankara.

“We entered there to end the rule of the tyrant Assad, who terrorizes with state terror,” Erdogan said. Yet he disavowed his words only two days later.

“We preached patience but could not endure in the end and had to enter Syria together with the Free Syrian Army,” he said, adding that they did this “ to restore justice ” to Syria, "not because they coveted Syrian territory."

This was brought home again when he claimed recently that the Turkish military was in Syria to put an end to Bashar al-Assad’s regime. Addressing the Istanbul meeting of the Association of Parliamentarians for Al-Quds (Jerusalem) on Nov. 29, Erdogan said the United Nations had done nothing while a million people were killed in Syria.

President Recep Tayyip Erdogan continues to learn the hard way that the international arena is not a place that will serve his political desires and ambitions. Yet he continues to come out with ill-considered outbursts that pose difficulties for Ankara at a time when it needs international support to overcome the difficulties it increasingly faces at home and abroad.

So, why did he change his mind? What happened between his first and second statements was the mild yet clear reprimand from a “surprised” Moscow. “We hope that in the near future there will be explanations on this from our Turkish partners,” President Vladimir Putin’s spokesman Dmitry Peskov told reporters in Moscow the day after Erdogan spoke.

Referring to Erdogan’s words as “a serious statement,” Peskov said these were “in discord with previous ones in general and with our understanding of the situation." He went on to underline that Russia was the only country whose military was in Syria legitimately having responded to a call by Damascus.

Peskov appeared to be reminding Ankara that Turkish forces are in Syria because Moscow and Damascus have allowed this on the basis of what Turkey originally declared its mission to be: namely, to combat the Islamic State.

Erdogan’s remark about targeting the Assad regime posed an added embarrassment for Ankara because it came only days before the foreign ministers of both countries were due to hold talks in Turkey during a meeting of the Turkey-Russia Strategic Planning Group.

Erdogan’s remark also came as Prime Minister Binali Yildirim was preparing to travel to Moscow on Dec. 5 for talks aimed at boosting ties, after the reconciliation between the two countries this summer following the Turkish downing of a Russian fighter jet in November 2015.

Ankara is keen to develop ties with Moscow as a counterbalance to its deteriorating ties with the West, leaving Erdogan’s remarks seriously at odds with this aim, given Russia’s well-known determination to back the Assad regime.

Iran, which is another country Turkey is trying to improve ties with despite its continued support for Assad, also reacted to Erdogan.

Echoing Russia’s position, Iranian Deputy Foreign Minister Ibrahim Rahimpour was quoted by the Russian media saying that Turkey should adhere to the previously agreed position on Syria.

Rahimpour’s statement also suggests that the Turkish presence in Syria will be tolerated as long as it remains within predefined and agreed-upon limits.

Erdogan’s often passionate and impulsive remarks to predominantly Muslim and Sunni audiences appear to have gotten the better of him again in this case, as he does not think through the consequences of his words and the difficulties they will pose for Turkey.

Erdogan has also been blasting Europe, which has angered him with statements on his authoritarian leanings, indicating that this could spell the end of Turkey’s bid for EU membership. He has also accused key European countries, most notably Germany, of supporting terrorists by harboring backers of the outlawed Kurdistan Workers Party (PKK) and the Gulen group, which Ankara says masterminded the failed July 15 coup attempt.

Erdogan called on Moscow’s support again recently, to help Turkey join the Shanghai Cooperation Organization and end its dependence on the European Union.

During his address to village and district heads in Ankara, Erdogan appeared nevertheless to tone down his anti-European rhetoric. He said Turkey was part of Europe for over 650 years and was ready to join the EU if Europe dropped its double standards.

He also held a phone conversation with German Chancellor Angela Merkel on Dec. 1, during which bilateral and regional topics — including the PKK, the Gulen group and Syria — were reportedly discussed in a friendly atmosphere. Erdogan used the opportunity to congratulate Merkel over Germany’s assuming the presidency of the G-20.

Erdogan's relatively softer approach toward Europe comes amid signs that Turkey may be heading for a serious economic crisis. The dramatic fall in the value of the Turkish lira against hard currencies has left citizens seriously concerned. Erdal Saglam, a commentator on economic affairs for daily Hurriyet, lists Erdogan’s angry anti-Western remarks among the reasons for Turkey’s worsening economic situation.

Erdogan also put Ankara in a difficult situation internationally in September, when he argued that the Lausanne Treaty, the founding document of the Turkish Republic, was not a victory because it conceded Greek islands located a stone’s throw away from the Turkish mainland.

The topic is still reverberating in Greece, even though, analysts argue, that as a staunch Islamist Erdogan was only trying to denigrate the secular establishment that founded modern Turkey.

Retired ambassador Suha Umar believes that all of this only reflects the fact that Erdogan is impulsive and has no strategic foreign policy vision.

“Erdogan says what comes to his mind at any given instant, whereas foreign policy is an area that requires a long-term vision and delicate planning to realize this through tactical statements and acts at strategic moments,” Umar told Al-Monitor.

“His biggest mistake is using foreign policy to promote his domestic agenda,” Umar said, arguing that this also undermines Turkey’s interests. As an example, Umar cited Erdogan showing his support for reinstating the death penalty by angrily defying calls from Europe not to do so in order to please his supporters.

“If you support the death penalty, then neither Greece nor any other European country will extradite fugitives sought by Turkey for plotting the July 15 coup, because their legal commitments under EU and Council of Europe regulations will prevent this,” Umar said.

This overall problem is even more crucial now that Erdogan appears set to become an executive president, following the government’s proposed revision to the constitution that will allow this.

Umar points out that when that happens, Erdogan will also become the only one calling the shots as far as foreign policy is concerned. Umar predicts a further deterioration in Turkey’s ties with the West and the Middle East because he does not believe Erdogan is capable of changing much at this stage.