A man walks near a building on fire following a reported airstrike by government forces in the rebel-held region of Eastern Ghouta, on the outskirts of the Syrian capital Damascus on Dec. 8. (Abdulmonam Eassa/AFP/Getty Images)

Syrian opposition and rebel groups agreed Thursday for the first time to unite behind a single body and a statement of principles that will form the basis for possible peace negotiations with the Syrian government next year.

Concluding a two-day meeting in the Saudi Arabian capital of Riyadh, representatives of the political and armed opposition agreed that the goal of the talks should be the departure of Syrian President Bashar al-Assad and the creation of a democratic and pluralistic state to replace his family’s four-decade-old regime.

The unusual display of unity was marred, however, by a walkout by the biggest and most radical of the rebel groups, Ahrar al-Sham, which objected to the role given to a Damascus-based opposition group and “other pro-regime personalities,” as well as the failure of the statement of principles to make reference to Syria’s “Islamic identity,” according to a statement issued by the group.

Representatives of Ahrar al-Sham, a Salafist Islamist group that has cooperated closely with al-Qaeda’s affiliate in Syria in the past, later returned to the conference amid signs that the group was split over participating in the process.

The walkout pointed to how deeply contentious the issue of negotiating with the regime is, especially for the armed groups that have been fighting for four years to topple Assad.

Russia’s intervention, however, has tilted the balance of power on the ground in favor of the government, while the expanding reach of the Islamic State and the surge of refugees into Europe have re­focused international attention on the need to solve the Syrian crisis.

Secretary of State John F. Kerry said in a statement that he welcomed “the positive outcome” of the Riyadh gathering, which he said would “bring us closer to starting negotiations between the Syrian parties.” However, he cautioned, “We recognize the difficult work ahead.”

Under the outlines of a plan agreed to by world powers in Vienna last month, representatives of the government and the opposition are supposed to meet in January for direct talks focused on securing a cease-fire and creating a transitional government to run Syria until elections are held.

According to the agreement reached in Riyadh, the opposition will be represented by a 32-member body that includes political and military representatives. The Western-backed Syrian Opposition Coalition and the Damascus-based National Coordination Body will be represented.

Military groups will be represented by Western-backed Free Syrian Army groups in the north and the south of the country, with eight representatives. Ahrar al-Sham and the Army of Islam will each have one.

But because of continued disagreements among world powers over the talks’ composition and purpose, it remains unclear whether negotiations will go ahead. Russia said Thursday that significant differences remain between Moscow and Washington on whom to label a “terrorist” in Syria. Assad has always labeled all his opponents “terrorists,” and it is far from clear whether his government will agree to talk to a group that includes members of the armed insurgency.

Western diplomats say that unless armed groups are represented at the talks, it will be impossible to implement any agreements reached on the ground.

But the opposition’s insistence that Assad should not be part of any transitional government is at odds with the position held by his main backers, Iran and Russia. They say he should remain president during any transitional period and be eligible to run in future elections.

Monzer Akbik, a member of the opposition coalition, said he doubted the negotiations would occur, at least not as early as January. Although Russia and Iran have agreed to the Vienna statement calling for a political settlement, “they are escalating their military actions on the ground,” he said. “So there is a contradiction between what they say and what they do.”