In what has been hailed as a major breakthrough, South Sudan's rival leaders have sealed an agreement on a key military provision of their stuttering peace deal.
President Salva Kiir and his rival, Vice President Riek Machar, agreed on the creation of a unified armed forces command, one of several crucial unresolved issues holding up implementation of the 2018 deal to end the country's bloody five-year civil war.
"Peace is about security and today we have (achieved) a milestone," said Martin Abucha, who signed the agreement on behalf of Machar's opposition SPLM/A-IO on Sunday.
Minister of presidential affairs Barnaba Marial Benjamin hailed the deal -- signed following mediation by neighbouring Sudan -- as a "necessary step... that opens a route for the stable government of the Republic of South Sudan".
Tensions between forces loyal to Kiir and former rebel leader Machar have spiralled recently, triggering fears in the international community of a return to full-blown conflict in the world's youngest nation.
Both men were at the ceremony in the capital Juba for the signing of the accord, which stipulates a 60-40 distribution in favour of Kiir's side of key leadership posts in the army, police and national security forces.
Mohamed Hamdan Daglo, the number two in Sudan's post-coup ruling council, had arrived in Juba on Friday in a bid to break the deadlock over the security arrangements.
Sudan, one of the guarantors of the 2018 deal, drew up the proposal after Kiir on March 25 issued a presidential decree on the formation of the military command structure, a move that had been swiftly rejected by Machar as a "unilateral" action.
Landlocked South Sudan, one of the poorest countries on the planet despite large oil reserves, has suffered from chronic instability since it declared independence from Sudan in 2011, spending almost half of its life as a nation at war.
It has struggled to draw a line under the 2013-2018 conflict that erupted after Kiir accused Machar of an attempted coup. Almost 400,000 people lost their lives and millions more were displaced by the fighting.
Although the two men formed a power-sharing unity government more than two years ago, South Sudan has continued to lurch from crisis to crisis, battling flooding, hunger, violence and political bickering that threatened to undo even the limited progress in the faltering peace process.
The fragile peacemaking was put under further pressure last month when Machar's Sudan People's Liberation Movement in Opposition (SPLM/A-IO) pulled out of a body monitoring the process to protest at continued "unprovoked" attacks of its bases by its "peace partner".
The United States last week expressed concern over the growing tensions, deploring reported clashes in Upper Nile State and warning that the opposition move undermined the peace agreement.
Last month, the UN Security Council voted to prolong its peacekeeping mission in South Sudan for one more year, although Russia and China abstained.
The operation, with up to 17,000 soldiers and 2,100 police officers, is one of the most expensive for the UN, with an annual budget surpassing $1 billion.
In a presentation to the Security Council, the UN envoy for South Sudan, Nicholas Haysam, issued a stark warning to the country's leaders to do more to prepare for elections due to be held in less than a year.
"Elections have the potential to be a nation-building moment, or a catastrophe," he said.
Although he highlighted progress in some areas including the operation of key government institutions and parliament, other issues are stalled, including the process of drafting a new constitution.
The UN has repeatedly criticised South Sudan's leadership for its role in stoking violence, cracking down on political freedoms and plundering public coffers.
South Sudan also faces humanitarian woes caused by conflict as well as climate-related disasters such as flooding and drought, prompting the UN on Thursday to launch a $1.6 billion aid plan.
It said the funding will be used to provide urgent life-saving assistance and protection in a country where it is estimated more than two thirds of the population, nearly nine million people, require aid relief.