South Sudan's warring leaders have agreed to a power-sharing deal that will see rebel leader Riek Machar return to his position as vice president, Sudan's foreign minister said.

"It has been agreed that there will be four vice presidents: the current two vice presidents, plus Riek Machar who will assume the position of first vice president, and then the fourth position will be allocated to a woman from the opposition," foreign minister Al-Dierdiry Ahmed said, following the meeting in Kampala aimed at ending more than four years of civil war in South Sudan.

The foreign minister said South Sudan's president Salva Kiir and rebel leader Mr Machar had agreed to the proposal, but that further details would be discussed at negotiations to be held in Khartoum and Kenya in the coming days.

The latest agreement is part of renewed regional diplomatic efforts to end a conflict that has killed tens of thousands and forced millions from their homes since December 2013.

The war began when President Kiir accused Mr Machar, his former deputy, of planning a coup.

A similar power-sharing deal, that returned Mr Machar to the vice presidency, was signed in 2015 but fell apart a year later in a deadly battle that saw him flee into exile.

On 27 June Mr Kiir and Mr Machar signed a ceasefire agreement which was further consolidated yesterday in the Sudanese capital, Khartoum, when the warring parties struck a deal to withdraw troops from urban areas.

Mr Ahmed said the new proposal was "accepted by the government" and that Mr Machar's opposition had accepted the deal "in principle" but would "consider it and come up with the final position" following further negotiations, to begin in Khartoum on Sunday.

Today’s day-long meeting was hosted by Uganda's President Yoweri Museveni and was attended by Sudanese President Omar al-Bashir as well as representatives of the opposition.