Political and economic developments in the European Union, Turkey and Russia are cumulatively aiding Russian President Vladimir Putin to become an ascending star in the international firmament. In an unexpected twist, the supporting actor in this dramatic ascent is Turkish president Recep Tayyip Erdogan, a former staunch critic of the Kremlin in the Syrian civil war who is now aligned with Putin in hostility towards the European Union.

The rise of rightwing populism in the EU – Brexit, improved performance by Geert Wilders’ Party for Freedom in the March 15 Dutch general election, and the lead position of the National Front’s Marine Le Pen in French opinion polls – is a contributory element. Another is the refugee crisis, which has widened the base of Europe’s rightwing parties. Though less severe now than in 2015, the present quiescent state of the refugee crisis depends on Erdogan’s good will. By closing Turkish borders with neighboring Greece, he drastically reduced the refugee influx into the EU. Equally, he could reverse his decision and revive the crisis.

At home, Erdoğan is keen to turn himself into a modern-day sultan. After aborting an attempted military coup on July 15, he declared a state of emergency and unleashed a massive crackdown on political opponents. This led to the purging of almost 100,000 employees in state institutions and the arrest of 40,000, including judges, senior civil servants, academics, journalists, and police and military officers.

After corralling the parliament to amend the constitution to replace parliamentary democracy with an executive presidency, he has urged voters to endorse the radical change in the April 16 referendum, arguing it is needed to avoid fragile coalition governments of the past and to give Turkey stability in order to meet security challenges in the future. His opponents fear an authoritarian, one-man rule by Erdogan.

His actions have unnerved Western leaders. By contrast, the Kremlin welcomes these in the context of an astonishing turnaround in relations with Ankara.

Getting close

Following Turkey’s downing of a Russian jet fighter in its airspace on November 15, 2015, Moscow imposed stiff economic sanctions on Ankara. As a result, annual bilateral trade plummeted from $38 billion to about $17 billion.

But in the aftermath of the attempted coup, Putin made a congratulatory call to Erdogan. Three weeks later, Erdogan met Putin in St Petersburg and thanked him publicly, saying that his call “meant a lot psychologically.” Putin announced that Russian trade sanctions on Turkey would be lifted step by step.

On the other side, Erdogan was angered by EU and US criticism over his crackdown on educational institutions, the judiciary and the media, including the jailing of 152 journalists. His Russia visit in August alarmed Western capitals. Since then, from the Western viewpoint, a stream of negative news, including two more meetings for the Turkish and Russian presidents, has continued.

After his talks with Putin in the Kremlin on March 10, Erdogan declared that alliances like NATO or allies that ignore Turkey’s interests did not have the right to question what Turkey does to protect itself. He added that no one has the right to object to Ankara’s measures in Syria or current negotiations with Russia on the purchase of an advanced S-400 anti-missile defense system. Erdogan indicated that his latest meeting with Putin had created an environment for facilitating further security cooperation with Moscow as well as in economic and military sectors.

NATO angle

During his first presidency, 2000 to 2004, Putin urged the United States and other leading Western nations not to expand NATO eastward. His plea fell on deaf ears. In March 2004, NATO membership increased by seven, including the Baltic states of Estonia, Latvia and Lithuania which abut the Russian border. In contrast, during the Cold War, a wide belt of socialist republics of Eastern and Central Europe existed between NATO and the Soviet Union.

Having regained the presidency in 2012, Putin embarked on a dual policy of active resistance to NATO expansion and weakening the alliance. Given this, Erdogan’s defiant tone would have been music to his ears. With 620,500 strong armed forces, Turkey ranks second in NATO after the Pentagon’s 1.379 million armed personnel.

On October 10, on the sidelines of a global energy conference in Istanbul, Erdogan advised Putin to resubmit a Russian bid long-range air missile defense systems for which Ankara had received bids from the United States and Europe. An earlier Russian bid had been rejected as too expensive. But after his March visit to Moscow, Erdogan revealed that Russia was offering a considerable discount.

The latest development disappointed Ankara’s NATO allies, intent on containing the Kremlin’s influence. But Turkey was unmoved. “In this field we have three criteria which are price, technology transfer and time of delivery,” explained Turkish Defense Minister Fikri Işık. “As a sovereign state, we can cooperate with any country that fulfills these requirements.”

It was his emphasis on Turkey’s sovereignty that led Erdogan to cooperate with Putin to help consolidate a January ceasefire in Syria. The subsequent conference in the Kazakh capital of Astana saw Turkey abandoning the United States and bonding with Russia diplomatically to end the Syrian conflict.

This event enabled Putin, a proud nationalist, to rebut robustly US President Barack Obama’s disdain for Russia voiced after Moscow’s February 2014 annexation of Crimea: “Russia is a regional power that is threatening some of its immediate neighbors, not out of strength but out of weakness.” By taking centre stage at the Astana conference, with a NATO member as its ally, Russia showed that it was a superpower. Putin’s popularity at home soared to 82% in September even though the economy was expected to shrink by 1% in 2016 due to continued low prices for oil and gas, Russia’s main exports.

Erdogan’s recent spats with Germany and the Netherlands on the issue of Turkish ministers being allowed to persuade gatherings of Turkish voters settled in these countries to vote “yes” in the referendum have gone down well with the Kremlin.

The Turkish president continues to highlight his republic’s sovereignty if only to bolster his chance of winning the referendum. Opinion polls in Turkey are on the razor’s edge, with aye and nay voters tied at 43%. Hence, each of the EU’s nearly 3 million Turkish voters counts.

EU doors closing?

By accusing German and Dutch governments of acting like Nazis by banning Turkish ministers’ addresses to fellow Turks in their cities on the grounds of security, Erdogan has destroyed much of the goodwill needed for Ankara’s successful application to become a full EU member.

In 1963 Turkey became an associate member of the European Economic Community, the predecessor to the EU. Turkey signed a Customs Union agreement with the EU in 1995 and four years later was recognized as a candidate for full EU membership. Subsequent negotiations had run into periodic roadblocks even before Ankara’s latest tensions with Berlin and Amsterdam.

An adversary of EU expansion, Putin is pleased to see Turkey’s chance of acquiring full EU membership rapidly diminish.

A lot depends on the result of the April 16 referendum. A yes vote would put 63-year-old Erdoğan in virtual control of Turkish politics for the next decade or longer. Conversely, a no vote would be the most serious setback to his authority since he took power in 2003 and could trigger political rebellion against him – thus abruptly ending the recent Russian-Turkish honeymoon.

Dilip Hiro is the author of After Empire: The Birth of a Multipolar World (Nation Books, New York and London).His latest book is Indians in a Globalizing Word: Their Skewed Rise (HarperCollins India).

This article first appeared on YaleGlobal Online.