JUBA, South Sudan — South Sudan opened a new chapter in its fragile emergence from civil war Saturday as the opposition leader Riek Machar was sworn in as President Salva Kiir’s vice president, a day after the two men agreed to form a coalition government that many observers prayed would last this time around.

The arrangement has twice collapsed before and numerous attempts at peace have failed, including a deal that saw Mr. Machar return as vice president in 2016 — only to flee the country on foot months later amid fresh gunfire.

On Friday, Mr. Kiir dissolved the previous government of the world’s youngest nation just as the United Nations released a report documenting the war’s toll.

South Sudan slid into civil war in 2013, two years after winning a long-fought independence from Sudan, as supporters of Mr. Kiir and Mr. Machar, then a rebel leader, clashed. The conflict has killed nearly 400,000 people, and more than two million people fled South Sudan during the civil war. Mr. Kiir has urged them to come home.