Sudan’s ousted Prime Minister Abdalla Hamdok is to be reinstated, after being placed under house arrest during a military coup last month.

All political detainees will be released as part of a new agreement between the military, civilian leaders and ex-rebel groups, mediators said.

On 25 October, Sudan’s military had declared a state of emergency and dissolved the civilian leadership.

It sparked weeks of mass protests in which at least 40 people have died.

The deal was reached late on Saturday night, and is to be signed into action on Sunday, the head of Sudan’s Umma Party, Fadlallah Burma Nasir, confirmed.

Mr Hamdok has agreed to the terms so that further bloodshed can be avoided

BBC