GENEVA — Bending to intense international pressure, Syria’s government and the Western-backed opposition agreed Friday to face each other for the first time since the start of the uprising against President Bashar Assad.

After three days of hostile rhetoric and five hours spent assiduously avoiding contact within the United Nations, the two sides will meet “in the same room,” said the U.N. mediator trying to forge an end to the civil war that has left 130,000 people dead since 2011.

Mediator Lakhdar Brahimi met separately with Assad’s delegation and representatives with the Syrian National Coalition, who arrived at the U.N. European headquarters five hours apart to ensure their paths would not cross.

“We never expected it to be easy and I’m sure it’s not going to be, but I think the two parties understand what’s at stake,” Brahimi said. “Their country is in very, very bad shape.”

Brahimi, a famously patient mediator, is credited with efforts to stabilize Iraq and Afghanistan after the U.S. ousted their governments. But he faces a formidable task to build peace in Syria, which has been flooded with al-Qaida-inspired militants. The conflict has become a proxy war between Iran and Saudi Arabia.

Syria’s government has made military gains and has capitalized on the influx of foreign militants, while the coalition nearly collapsed as it wavered on whether to attend the talks at all. After Brahimi spoke, a member of the group said it still wasn’t clear what would happen Saturday.

“Everybody will be in the same room, but everybody will address Mr. Brahimi. … There will be no direct negotiation with the regime.” said Louay Safi.