BEIRUT, Lebanon - Syrian opposition and rebel groups agreed on 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 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 Syria affiliate in the past, later returned to the conference amid signs that the group was split over whether to continue 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 back in favor of the government, while the expanding reach of the Islamic State and the surge of refugees into Europe have refocused international attention on the need to solve the Syrian crisis.

Secretary of State John Kerry said in a statement that he welcomed "the positive outcome" of the Riyadh gathering, saying it 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 that to run Syria until new 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.

But it remains unclear whether the talks will go ahead because of continued disagreements among world powers over their composition and purpose.