Russian President Vladimir Putin has brought Turkey’s Erdogan and Iran’s Rohani together in a meeting that resulted in a watershed agreement to hold a Syrian Congress comprising pro-regime and opposition leaders in a bid to end the six-year civil war.

The Russian leader hosted the talks in Sochi, just as some Syrian opposition groups met in Saudi Arabia’s capital, Riyadh, ahead of United Nations-sponsored talks in Geneva.

The summit between the three powers, all deeply involved in the Syrian conflict, is designed to pave the way for a settlement likely to leave Syria’s Russian- and Iranian-backed president, Bashar al-Assad, in power within a reformed Syrian constitution.

It follows the near-collapse of the Syrian opposition since Moscow’s armed intervention in 2015 and the military defeat of Islamic State in all of the major towns and cities that were under its control.

“The militants in Syria have sustained a decisive blow and now there is a realistic chance to end the multi-year civil war,” Putin declared as he hosted Iran’s Hassan Rouhani and Turkey’s Recep Tayyip Erdoğan in Sochi.

“The Syrian people will have to determine their own future and agree on the principles of their own statehood. It is obvious that the process of reform will not be easy and will require compromises and concessions from all participants, including of course the government of Syria.”

Putin urged Iran and Turkey to start a discussion with him on the reconstruction of Syria. “Given the colossal scale of the destruction, it would be possible to think together about the development of a comprehensive program for Syria,” he said.

Rouhani said the grounds for a political settlement had been laid but he argued it was “unacceptable” for foreign troops not invited into Syria by the government to remain in the country – a reference to US troops in the northeast of the country.