South Sudanese rivals President Salva Kiir and rebel leader Riek Machar signed a peace agreement in Khartoum on Wednesday under which a ceasefire would take hold after 72 hours.
"This agreement signed today and the ceasefire will end the war in South Sudan, and opens a [new] page," Mr Machar told reporters after the signing ceremony in the Sudanese capital, while President Kiir said he would "commit respectfully" to the deal.
The agreement also included the opening of crossings for humanitarian aid, the freeing of prisoners and the formation of a provisional government after four months, Sudan's Foreign Minister Al-Dierdiry Ahmed announced following the talks. "All parties have agreed on a permanent ceasefire within 72 hours of signing the Khartoum Document."
A new new round of talks between President Kiir and Mr Machar opened on Monday in Khartoum, hosted by Sudan's President Omar Al Bashir.
"We offer this agreement as a gift to South Sudanese citizens," President Bashir said. "This agreement says that peace has started to return to South Sudan."
The talks were launched in Addis Ababa last week by East African leaders who are calling for an end a brutal four-and-a-half-year civil war in the world's youngest country.
The two rival factions face a looming deadline to avert UN sanctions.
Their meeting last Wednesday was the first since a peace deal between the government and Mr Machar's rebel group fell apart in August 2016 but ended without agreement. President Al Bashir then offered to host a second round of talks in Sudan.
On Monday, Mr Kiir and Mr Machar had indicated their readiness to talk peace as the Khartoum dialogue opened in the presence of President Al Bashir and Ugandan President Yoweri Museveni.
“I have come to really bring this unnecessary war in our country to an immediate end, and I hope that Doctor Riek Machar is ready to see my point,” Mr Kiir said.
Beginning in December 2013, the South Sudan's civil war crushed the optimism that accompanied Juba's declaration of independence from Sudan just two years earlier. The fighting, which began after President Kir accused his then-deputy Mr Machar of plotting a coup, has killed tens of thousands and displaced over three million.
Previous ceasefire agreements have been violated.
A 2015 deal which raised hopes of peace collapsed in July 2016, with Mr Machar fleeing to South Africa and President Kiir's government gaining the upper hand as the opposition splintered into numerous factions.
"I don't think this agreement will work," said Luka Biong, professor at the National Deference University in Washington DC and former minister from South Sudan. With so much bad blood between the two leaders, peace was unlikely while they remain in leadership positions, he believed.
"In order to make it a national reconciliation you need to include clerks and national figures who are willing to ease the bitterness between Salva and Machar," Dr Biong said. "If there are clerks and national figures included they could convince them both to leave power for the younger generation."
Other issues remained unresolved by the agreement, he said. "The agreement is not very clear regarding some important issues such as the army, whether they will have one army or two, and the issue of the states, whether they will remain 32 or they will be only 10."