Under the agreement, Salva Kiir will remain President... and Riek Machar will be re-instated as the first of 5 vice Presidents.
Machar held the position under Kiir from 2011-2013, before being dismissed over allegations of plotting a coup d'etat.
The deal was signed in the presence of Sudanese President Omar al-Bashir and his counterparts from Kenya, Uganda and Djibouti, along with foreign diplomats.The former rivals will be tasked with forming a transitional government which will hold power for three years.
The transitional government will include 20 ministers from Kiir's allies, nine from Machar's and six from other groups, according to the deal."The agreement we have just signed today must map the end of conflict and war in our country," Kiir said in a speech in English after signing the deal.
"We should ... rededicate ourselves to unite our people and work for peaceful transfer of power through the ballot boxes rather than through bullets."Machar urged the regional east African bloc Intergovernmental Authority on Development (IGAD), which is pushing the latest peace talks, to ensure that the deal is implemented.
"I would urge ... IGAD to focus after this on the implementation of the agreement," Machar said in his address.
"Somebody said that the devil sometimes is embedded in the implementation."
It's the latest of several attempts at peace deals in South Sudan since war broke out in 2013... the most recent having collapsed in 2016. Despite being sceptical when the deal was originally announced, the US showed its support for the move.
"We are supporting any initiative to bring peace to South Sudan and we hope this process will continue comprehensively," US Charge d'Affaires in Khartoum, Steven Koutsis, told reporters after Sunday's deal was signed.
The United Nations said the power-sharing deal was a "significant step"."By signing this agreement the guns must keep silent," said Nicholas Haysom, special UN envoy to Sudan and South Sudan.