The president of South Sudan and head of the country's main rebel group have signed a final cease fire and power-sharing agreement hailing a new longed-for era of peace in the country.
"I call on everyone as a leader of South Sudan that this agreement which we have signed today should be the end of the war and the conflict in our country," said President Salva Kiir.
South Sudan's former vice president and rebel leader Riek Machar said after the signing, "today we celebrate, not just in South Sudan, but throughout the world."
South Sudan became independent from Sudan in 2011, but civil war broke out two years later between the government led by Kiir and a rebel movement led by Machar.
Fuelled by personal and ethnic rivalries, the conflict has killed tens of thousands, displaced an estimated quarter of South Sudan's population of 12 million and ruined its economy that heavily relies on crude oil production.
"An agreement on outstanding issues has been signed and this agreement expresses the commitment of all parties to a ceasefire," the foreign minister of neighbouring Sudan, Al-Dirdiri Mohamed said on Sudan state television.
Sudan helped broker the agreement.
Sudan's president Omar al-Bashir said on Sunday oil would be pumped from South Sudan's Wahda region to Sudan beginning 1 September.
"There will be profit brother Salva ... one of our goals is the need to save the economy of South Sudan because it has reached a level of collapse," he said on Sudan State TV.
Previous peace agreements held for only a matter of months before fighting resumed, which Mr Kiir has blamed on foreign influence.
"My government and I know the conflict in South Sudan has resulted in a financial and political burden," Mr Kiir said.
"We must accept that the internal war has no meaning and has imposed suffering on us and our families and has killed hundreds of our young men and women, destroyed our economy, and left us divided."
Mr Machar said, "there is no option but peace ... we have to focus after this stage on implementing the agreement that if we don't implement, we will all be failures."
On Friday, Mr Kiir said he believed the new peace deal between his government and the main rebel group would not collapse because it was not forced upon them like previous accords.
He urged dialogue with the United Nations Security Council on how to secure the region from threats and keep the peace.