Once the final deal is signed, the foes will have three months to form a transitional government.
President Salva Kiir and his rival Riek Machar were in neighbouring Sudan on Sunday to sign the deal, under which the rebel leader is set to return to a unity government as the first of five vice presidents.
The deal, which paves the way to a final peace accord, was signed in the presence of Sudanese President Omar al-Bashir and his counterparts from Kenya, Uganda and Djibouti, along with foreign dignitaries.
Once a final peace deal is signed, the foes will have three months to form a transitional government under the new format, which will then take effect for a further 36 months. A similar arrangement fell apart in July 2016 when fighting erupted in the capital, Juba, and Machar fled the country.
“The agreement we have signed today must map the road to end the conflict and war in our country,” Kiir said.
“We have to concentrate on the implementation of the agreement and we have to work on uniting our people.”
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 want IGAD to focus on the implementation of the deal because devil lies always in the implementation,” he said in his address.
The talks come as part of a regional push aimed at achieving peace in the country, which plunged into a devastating conflict just two years after its independence from Sudan.
“[Kenyan] President Uhuru Kenyatta has decided that further negotiations will continue in Khartoum and not in Nairobi,” Sudanese Foreign Minister Al-Dierdiry Ahmed said at Sunday’s signing ceremony.
South Sudan’s nearly five-year conflict began after Kiir accused his then-vice president Machar of plotting a coup against him in 2013.
Several ceasefire agreements were signed and breached over the course of 2014, with millions of civilians being displaced as a result of the ensuing violence.
The two sides first agreed to share power in mid-2015. Peace reigned for a year before renewed fighting led Machar to flee the capital and declare the deal dead.
Earlier in July, the two leaders preliminarily agreed to the power-sharing arrangement they signed on Sunday but 12 hours later, fighting resumed. Sunday’s deal is the 12th ceasefire and second power-sharing agreement.
The rival groups have already agreed on a permanent ceasefire and withdrawing of their forces from civilian areas, in talks mediated by Khartoum in series of dialogues hosted by al-Bashir.
The power-sharing deal stipulates that there will be 35 ministers in the bloated transitional government, including 20 Kiir allies and nine backers of Machar along with representatives of other rebel factions.