Russian President Vladimir Putin visited Turkey on Thursday for talks with President Recep Tayyip Erdogan that focused on the situation in Iraq and Syria along with bilateral trade.

Mr. Putin's visit came as Turkey and Russia are working to deepen ties in a turnaround for the two nations, which have backed opposing sides in Syria and nearly came to blows over Turkey's downing of a Russian plane in 2015.

The two leaders showered one another with praise in statements after their talks in Ankara, hailing a deal to de-escalate fighting in Syria.

Moscow sides with Syrian President Bashar Assad while Turkey has supported his foes since the start of the Syrian civil war six years ago. But Russia and Turkey, together with Iran, are now working on setting up de-escalation zones in Syria that are credited with having helped reduce the fighting.

Erdogan said they focused on the specifics of securing a de-escalation zone in Syria's northern province of Idlib on the border with Turkey, emphasizing the shared political will to contribute to the Syrian political settlement.

Putin, for his part, hailed "our friend, President Erdogan" for helping make the de-escalation deal possible, adding that it would allow to halt fighting and create conditions for the return of refugees to their homes.

"I consider these agreements our common, extremely important success," Putin said. "The necessary conditions have been created for putting an end to the fratricidal war in Syria, completely destroying terrorists and allowing Syrians to return to peaceful life."

The Russian leader added that "we are creating conditions for the refugees' return, and – which is of principal importance – for stepping up the search for a long-term political settlement in Geneva."

The Syria deal helped warm up ties and restore bilateral trade and the flow of Russian tourists to Turkey, halted in the wake of the 2015 plane incident.

Putin and Mr. Erdogan also talked about the Iraqi Kurdish referendum held Monday, with the Turkish president denouncing it as a "big mistake" that eroded stability in the region.

Erdogan underlined the need to prevent "even more serious mistakes," adding that "it's important that the international community sides with Iraq's territorial integrity and political unity."

Turkey, which is battling a more than three-decades-old Kurdish insurgency, strongly opposed the plebiscite, in which Iraqi Kurds voted overwhelmingly for independence. Turkey has said it considering economic sanctions against the semi-autonomous Kurdish region in Iraq and has not ruled out military action.

Russia has sought to maintain a neutral tone regarding the Kurdish referendum, but it underlined its support for Iraq's sovereignty and territorial integrity while emphasizing the need to avoid destabilization of the region.

At the same time, the Russian Foreign Ministry on Wednesday expressed Moscow's respect for the Kurds' interests and called for a dialogue between the Iraqi government and the Kurds to decide on a "mutually acceptable formula of co-existence within the integral state of Iraq."

Putin on Thursday referred to that statement without going into further details.

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

The two leaders didn't mention a deal for Turkey to buy Russia's most advanced air defense missile system, the S-400. Erdogan announced earlier this month that Turkey had signed a deal to buy the S-400s, drawing concern of some of Turkey's NATO allies who pointed that they aren't compatible with NATO weapons systems.

This story was reported by the Associated Press.