South Sudan's government and rebels have signed a cease-fire after more than five weeks of fighting that has divided Africa's newest nation and brought it to the brink of civil war, Reuters news agency reported.
Fighting between troops loyal to President Salva Kiir and those backing the vice president he sacked in July, Riek Machar, erupted in mid-December.
The conflict quickly deteriorated into all-out war between the regular army, backed by Ugandan troops, and defectors and ethnic militias, with the violence also pitting members of Kiir's Dinka tribe against some from Machar's Nuer group.
Both sides previously said they were close to a deal, but disagreements have until now pushed back any signing.
Rebels had demanded the release of 11 of Machar's allies, detained by the government and accused of attempting a coup. That demand was dropped as a precondition, but both sides agreed to discuss the issue of detainees on a separate track.
Rebel spokesman Garang said freeing the detainees was "not so much of a demand, since everyone recognizes the need for their release."
The rebels have also demanded the Ugandan army leave South Sudan. Diplomats at the talks said the deal would call for an end to "involvement by foreign forces."
Thousands of people have been killed and hundreds of thousands driven from their homes in the oil-producing nation, one of Africa's poorest.
South Sudan won its independence from Sudan in 2011 after decades of conflict between the northern and southern Sudanese.