South Sudanese President Salva Kiir and rebel leader Riek Machar on Sunday signed a final peace deal in latest efforts to end the civil war in the country.
President Kiir and Dr Machar signed an accord on governance and security arrangements after a round of peace talks in the neighbouring Sudan's capital, Khartoum.
Under the deal, Kiir will continue to serve as president and Dr Machar reinstated as the first vice president.
Other four vice presidents will be appointed from other political groups in addition to 35 ministers and 550 members of parliament.
The rival groups have already agreed on a permanent ceasefire and withdrawing of their forces from civilian areas.
Present at the signing ceremony were Sudanese President Omar Bashir, Kenyan President Uhuru Kenyatta, Ugandan President Yoweri Museveni, Djibouti President Ismaïl Omar Guelleh and other regional and international representatives.
The opposition coalition of the South Sudan Opposition Alliance (SSOA) and other opposition factions who had earlier rejected the deal due to differences over the contents of the accord have all signed the pact.
The new agreement comes after the two arch-rivals came under pressure from the regional and the international community to end hostilities.
Washington has been sceptical about the success of the latest peace initiative, given the fiery enmity between Kiir and Machar.
Last month the White House warned that "a narrow agreement between elites" would not solve the problems plaguing South Sudan."
"In fact, such an agreement may sow the seeds of another cycle of conflict," it said.
But on Sunday the top US envoy to Khartoum said the United States still backed the process.
"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.
A similar peace deal was signed in 2015 but fell apart a year later in a deadly battle that saw Machar flee into exile.
Kiir vowed Friday that the latest peace bid will "not collapse".
But he highlighted several challenges going forward, especially in accommodating a bloated government.
"They need security, they need vehicles, they need houses...five vice presidents, this is a very big responsibility to manage," he said.
"I need to get for them their transport, and one person needs a motorcade of maybe five vehicles. Where will I get this?"
"There are so many things need to be done," he added.
South Sudan attained independence from Sudan in 2011 but descended into a civil war two years later.
The war erupted following a power wrangle between President Kiir and his former deputy Dr Machar.
The war has caused one of the largest humanitarian crises in the continent, according to the UN.
About 2 million South Sudanese have become refugees in neighbouring countries.
The International Crisis Group estimates that more than 100,000 lives have been lost in the young nation from from 2013 to 2015 alone.
Additional reporting by AFP.