ANKARA, Turkey — 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.

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.

Putin and 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.