Ties between Russia and Turkey are growing closer than ever, as Russia runs into widespread diplomatic fallout from the poisoned spy scandal and Turkey’s relations with its Western allies worsens over human rights issues and its military operations against Kurdish militia in Syria.

Russian President Vladimir Putin heads back to Turkey on Tuesday, joining Turkish President Recep Tayyip Erdogan at a symbolic ground-breaking ceremony for a Russian-made nuclear power plant being built on Turkey’s Mediterranean coast at Akkuyu. On Wednesday, Putin, Erdogan and Iranian President Hassan Rouhani are expected to hold a summit in the Turkish capital of Ankara to discuss Syria’s future.

Turkey and Russia have put aside their traditional rivalries and differences on regional issues to forge strong economic ties. In December, they finalized an agreement for Turkey to purchase Russia’s long-range S-400 missile defense system, a deal that raised eyebrows among some of Turkey’s NATO allies. Aside from the power plant, the two countries are also building the “Turkstream” pipeline to transport Russian gas to Turkey.

“Turkish-Russian relations are in a better mood compared with two years before . both parties are working together,” said Mitat Celikpala, a professor of international relations at Istanbul’s Kadir Has University.

“They managed to compartmentalize issues,” Celikpala said, citing Turkish and Russian divisions, including over the divided island of Cyprus and Russia’s 2014 annexation of Crimea. “If you set aside all those issues . they are good partners for the resolution of immediate interests.”

Their warming relations come as ties between European Union nations and Turkey have become increasingly testy.

Turkey’s EU membership talks have stalled and many EU countries have voiced concerns over the Turkish government’s growing authoritarian turn and its crackdown on rights and freedoms, especially following an attempted coup in 2016 that Turkey blames on a U.S.-based Islamic cleric.

Turkey in turn, accuses EU countries of supporting Kurdish rebels as well as the alleged perpetrators of the 2016 failed coup.

Turkey’s relations with the United States have fared even worse, with Turkey accusing Washington of harboring the cleric, Fethullah Gulen, and backing Syrian Kurdish militia that Turkey considers to be terrorists.

Last week, Turkey announced it would not be following NATO and EU allies in ousting Russian diplomats in response to the poisoning in Britain of a former Russian spy. Britain has accused Russia of being behind the nerve agent attack on former double agent Sergei Skripal and his daughter, prompting nearly two dozen nations to expel over 150 Russian diplomats. Russia has responded by expelling a similar number of envoys.

Turkey condemned the nerve agent attack on British soil without naming Russia, adding that it enjoyed “positive” relations with Moscow.

“Just because some countries took a step based on an allegation, we don’t have to take the same step,” Erdogan said.

Putin and Erdogan have met several times in the past year and regularly speak on the phone.

Russia and Turkey — along with Iran — are also working together to create “de-escalation zones” to reduce the fighting in Syria and bring the sides of the conflict together to negotiate Syria’s future.

The cooperation comes despite their positions on opposing sides in the Syrian conflict —with Moscow siding with Syrian President Bashar Assad and Turkey supporting his foes since the start of the Syrian war seven years ago.

The conflicting interests led to the downing of a Russian warplane by a Turkish jet at the Syrian border in November 2015, which put the two nations on the verge of a direct military conflict.

Russia responded by barring packaged tourist tours to Turkey and halting the imports of agricultural products. The two reconciled after Erdogan issued an apology.