Sudan’s military plans to reinstate ousted Prime Minister Abdalla Hamdok following an agreement reached in the late hours of Saturday, Fadlallah BurmaNasir, the head of the Umma Party, told Reuters.

Hamdok will form an independent cabinet of technocrats and all political detainees will be released under the agreement between the military and civilian political parties, Nasir said on Sunday.

Nasir said he took part in a meeting late on Saturday in which mediators reached a deal.

The Sovereign Council will hold an urgent meeting on Sunday before announcing the agreement, said a source with knowledge of the talks.

Hamdok was placed under house arrest when the military seized power on Oct. 25, derailing a transition towards democracy agreed after the overthrow of long-ruling autocratOmar al-Bashir in 2019.

The military dissolved Hamdok’s cabinet and detained a number of civilians who held top positions under a power-sharing deal agreed with the military following Bashir’s ouster.

Following the coup, Hamdok had demanded the release of all political detainees and a return to power-sharing as a precondition for negotiating, according to sources close to him.

The coup triggered a campaign of mass demonstrations against the military, and activists had called for further protests on Sunday.

Western powers that had backed Sudan’s political transition condemned the takeover and suspended some economic assistance to Sudan.