United Nations envoy Lakhdar Brahimi appeared to have averted the collapse of peace talks Friday between Syria’s government and opposition after a fraught day, telling reporters in the late afternoon that the two sides have agreed to meet in the same room on Saturday.

After a day of threats and ultimatums that put the entire peace effort in jeopardy, Brahimi said he had secured the commitment of both sides to attend their first direct talks after they failed to take place on Friday.

Asked what guarantees he had received that the two sides would show up, Brahimi responded: “That is a very good question,” and refused to elaborate, suggesting that it was possible one side or the other might not show up.

The talks failed to convene Friday after the opposition refused to attend the first scheduled meeting with the government delegation because the government had not explicitly accepted the terms under which the talks are being held. That prompted a threat from the Syrian delegation to go home Saturday.

At the heart of the dispute was the government’s refusal to accept the terms of the Geneva I communique, which spells out that the purpose of the conference, among other things, is to negotiate a transitional government to replace the current regime.

Timeline: Unrest in Syria

Two years after the first anti-government protests, conflict in Syria rages on. See the major events in the country's tumultuous uprising.

But after meeting separately with the two delegations, Brahimi said he had secured the commitment of the government to the Geneva communique, and the Syrian Opposition Coalition said Friday night that it would show up Saturday.

“Brahimi told us the negotiations will be about the execution of Geneva I,” coalition spokesman Louay Safi told reporters Friday night.

The focus will shift almost immediately to efforts to secure local cease-fires and provide humanitarian aid to stricken areas, Brahimi said, which will present an early test of the two sides’ commitment to deliver at least some results from the talks.

Diplomats and observers said the brinkmanship and posturing was understandable after the scale of the past three years of bloodshed but said the fact that both sides remain in Geneva signifies that they are serious about securing some form of negotiated settlement.

“It was to be expected that neither party would accept easily to be at the same table as the other party on the first day,” said Ibrahim Hamadi, a veteran Syrian journalist who spent years in Damascus for the al-Hayat newspaper. “But the train has left the station and the peace process is starting.”

Both the Syrian government and opposition are under intense pressure from their supporters not to offer any concessions and from their international allies to remain at the talks. Both sides risk losing international support if they are seen as responsible for torpedoing the peace effort. And ordinary Syrians on both sides desperately want the talks to make at least some progress toward reducing the horrendous levels of violence, adding to the incentive for both sides not to quit.

In a speech at the World Economic Forum in Davos, Switzerland, Secretary of State John F. Kerry said Friday that despite the setbacks, the United States continues to believe that ultimately diplomacy will end the conflict in Syria.

“This week we also saw the Syrian regime and the opposition sit in the same room — separate tables but in the same room — for the first time since the war began,” Kerry said, referring to the international conference earlier this week in Montreux that launched the peace talks.

Also in Davos, Iranian Foreign Minister Mohammad Javad Zarif drew laughter when he called for the withdrawal of “foreign elements” from Syria, while denying that Iran itself is sending fighters to the country.

Iran’s Revolutionary Guard Corps is widely reported to have contributed fighters, and Iran is one of Syria’s main sources of military resupply.

“I can ask all foreign forces to withdraw from Lebanon and from Syria, and we will do our best,” Zarif said at the World Economic Forum. As the moderator and audience laughed, he flashed a wry smile.

“What I can ask is for all foreign elements to leave Syria to allow the Syrian people to decide their own future, to stop funneling funds and money and arms to Syria and to allow the Syrian people to decide their destiny,” he said.

“We were not invited, but we hope that Geneva can produce results, because we are in the region and we will be affected by any disaster coming out of Geneva,” Zarif said.

Gearan reported from Davos. Ahmed Ramadan in Beirut contributed to this report.