The rival factions of the Sudan People’s Liberation Movement, today signed a declaration of unity in Cairo that will pave the way for an end to hostilities that plunged the young nation into a bloody war.

The Sudan People’s Liberation Movement split into two factions, SPLM-Juba led by President Salvar Kiir and SPLM-IO led by Dr. Riek Machar following the breakout of a civil war in December 2013.

Without naming the heads of the respective delegations, a post from the Egyptian embassy in Kampala late Thursday, said the two factions had signed the “Declaration of Unification,” at the headquarters of the Egyptian Intelligence Service in Cairo, in a deal brokered by Ugandan President Yoweri Museveni and his Egyptian counterpart Abdel El-Sisi.

The factions agreed to support peace efforts, end the dispute that had ripped the SPLM apart as well as the return of all displaced persons to South Sudan. The Egyptian intelligence service will police implementation of the agreement.

If it holds, the truce will be welcome by Uganda which is playing host to 1.2 million South Sudan refugees. The conflict that is now running for the fourth year has exacted a heavy toll on Kampala that smoked millions of dollars to prop up President Kiir’s shaky hold on to power in the fractious country.