Government and rebel representatives are expected to sign a new power-sharing agreement in Uganda on Saturday.

South Sudan‘s warring sides have signed an accord on security arrangements after talks in neighbouring Sudan’s capital, a step that could lead to a power-sharing deal.

“All parties have agreed to withdraw military troops from urban areas as part of the security agreement,” Jamal Omar, Sudanese chief of military intelligence, said at Friday’s signing ceremony in Khartoum.

The agreement comes days after foes Salva Kiir, the president of South Sudan, and Riek Machar, his former vice president and now rebel leader, agreed to a permanent ceasefire, raising hopes for an end to the five-year conflict that has devastated the world’s youngest country.

The latest ceasefire was violated hours after it began with the government and armed opposition trading blame for attacks that killed 18 civilians.

The ceremony for Friday’s deal, the latest in the round of peace talks, took place at Sudan’s defence ministry in the presence of Machar, South Sudanese government officials and journalists.

Omar said a security committee would also be set up to monitor the implementation of the deal, which allows the opening of humanitarian corridors to deliver aid.

“The security deal stipulates that there will be no military presence in churches, villages, schools and camps,” he said.

Sudanese Foreign Minister Al-Dierdiry Ahmed said the warring factions have also agreed to immediately free detainees.

“It’s time for our brothers to put down their weapons,” Ahmed said at the ceremony.

He was quoted by AFP news agency as saying that the rival groups have also entered talks on power-sharing, the details of which would be discussed on Saturday in Uganda’s capital, Kampala, at a summit between Ugandan President Yoweri Museveni, Kiir and their Sudanese counterpart President Omar al-Bashir.

The two warring sides have yet to agree on a power-sharing agreement and South Sudan’s government has rejected the idea of Machar returning as Kiir’s deputy.

The fighting in South Sudan has killed tens of thousands, uprooted about a quarter of its 12 million population, gutted oil production and ruined an already widely impoverished economy.