By Denis Pinchuk and Stephen Kalin

SOCHI, Russia/RIYADH (Reuters) - Russia's Vladimir Putin hosted the presidents of Turkey and Iran to discuss Syria on Wednesday, launching a major diplomatic push to finally end a civil war that has been all but won by the government of President Bashar al-Assad.

Syrian opposition groups, meeting in Saudi Arabia to seek a unified position ahead of peace talks, decided to stick to their demand that Assad leave power, Al Arabiya television reported, following speculation they might soften their stance after their hardline leader quit.

Putin, who hosted Hassan Rouhani and Tayyip Erdogan in the Black Sea resort of Sochi two days after being visited there by Assad, said the Iranian and Turkish presidents had agreed to support a Russian proposal for a "Syrian people's congress".

Russia wants the congress, also to be held in Sochi, to open dialog alongside a formal U.N.-sponsored peace process in Geneva.

Syria's civil war, which is in its seventh year, has killed hundreds of thousands of people and created the world's worst refugee crisis, driving more than 11 million people from their homes.

All efforts to achieve a diplomatic solution have swiftly collapsed, with the opposition demanding Assad leave power, the government insisting he stay on, and neither side possessing the strength to force the issue by achieving a military victory.

But since Russia joined the war on behalf of Assad's government in 2015, the balance of power has turned decisively in the government's favor. A year ago, the army forced rebels out of their last urban stronghold, the eastern half of Aleppo.

In recent weeks, the self-proclaimed caliphate of the Islamic State group has collapsed. Government forces now effectively control all of Syria apart from a few shrinking rebel pockets and a swathe in the north held by mainly Kurdish forces backed by the United States.

STILL SEEKING ASSAD EXIT

Opposition groups held their meeting on Wednesday at a luxury hotel in Riyadh, two days after the leader of the High Negotiations Committee (HNC) that has represented them at previous peace talks quit abruptly.

Story continues

HNC chief Riyad Hijab had been known as an uncompromising defender of the position that Assad must have no role in any political transition for Syria, and his resignation had led to speculation the opposition could soften its stance.

However, a draft of the meeting's final statement still included the demand Assad leave office at the start of any transition, Saudi-owned Al Arabiya television reported.

Having helped Assad's government reach the cusp of victory, Putin now appears to be playing the leading role in international efforts to end the war on Assad's terms.

The Russian leader has also spoken to U.S. President Donald Trump and Middle East leaders this week.

Iran has long supported Assad.

Saudi Arabia, Iran's arch rival in the Middle East and long a backer of rebel groups in Syria and advocate of the position that Assad must leave, has been the main supporter of the HNC.

But after King Salman made an historic visit to Moscow a few months ago, Riyadh appears to have come around to Russia's dominant role in Syria.

Similarly Turkey, traditionally one of the Syrian leader's implacable foes, has increasingly shown willingness to work with Russia to resolve the crisis.

"This summit is aimed at results. I believe critical decisions will be reached," Turkey's Erdogan said in Sochi.

The other major power with troops in Syria, the United States, has so far kept its distance. Washington has been arming, training and sending special forces to assist a Kurdish group fighting against Islamic State, angering Turkey which is fighting its own Kurdish insurgency.

HARD DISCUSSIONS

Still, any final settlement that keeps Assad in power will probably require the participation of some kind of opposition delegation willing to negotiate over the demand that he go.

U.N. peace talks mediator Staffan de Mistura, host of the formal peace process in Geneva, told the opposition groups at the Riyadh meeting they needed to have the "hard discussions" necessary to reach a "common line".

"A strong, unified team is a creative partner in Geneva and we need that, one who can actually explore more than one way to arrive to the goals that we need to have," he said.

De Mistura will meet Russia's defense and foreign ministers on Thursday to discuss preparations for a new round of Geneva talks, Russian news agency RIA reported.

Russia said on Tuesday that the resignation of such "radically minded" Syrian opposition figures as HNC chief Hijab would help unite the disparate opposition factions around a more "realistic" platform.

(This story corrects year Russia joined Syria war to 2015 from 2014 in paragraph 7)

(Additional reporting by Suleiman al-Khalidi and Dahlia Nehme; Writing by Peter Graff; editing by John Stonestreet)