Nearly a month after Sudan's top general ousted the prime minister, they signed a breakthrough deal on November 21 to reverse the military takeover that had sparked international condemnation and mass protests.

General Abdel Fattah al-Burhan appeared at the presidential palace in Khartoum for a televised ceremony with a haggard looking premier Abdalla Hamdok, who had just been freed from house arrest.

The 14-point deal restores the transition to civilian rule that had been derailed by the October 25 putsch, which threw the poverty-stricken northeast African country into renewed turmoil and set off a wave of street protests.

The agreement, which comes after weeks of crisis talks involving Sudanese and outside players, declared that "the decision of the general commander of the armed forces to relieve the transitional prime minister is cancelled" and to release all political detainees.

It raised hopes Sudan will be able to return to its fragile transition process toward full democracy that started after the 2019 ouster of veteran autocratic president Omar al-Bashir.

Despite the breakthrough, thousands of protesters again rallied in several cities, met by security forces who fired teargas in the capital – the latest of a series of protests that, medics say, have claimed 40 lives.

A frail looking Hamdok was seen on air extolling the virtues of the "revolution" that brought him to power in 2019.

Standing beside him, Burhan thanked Hamdok for his service and vowed that "free and transparent elections" would be held as part of the transitional process.