NAIROBI, Kenya — Sudan’s prime minister was released from detention on Sunday, four weeks after he was ousted in a military coup, as part of a deal to end a bloody standoff that has led to dozens of protester deaths and threatened to derail Sudan’s fragile transition to democracy.
The prime minister, Abdalla Hamdok, was released hours after mediators said that he had struck a deal with Lt. Gen. Abdel Fattah al-Burhan, the army chief who ousted him from power on Oct. 25, providing for Mr. Hamdok’s immediate reinstatement, and for the release of most other political detainees.
Sudanese state media said that Mr. Hamdok had been brought to the presidential palace, where reports said a deal-signing ceremony was being prepared. The state media report was accompanied by a photograph showing Mr. Hamdok and General al-Burhan sitting together, although it was unclear if the image had been taken on Sunday.
The exact terms were unclear, and there were early signs that the deal would be wholly rejected by the angry young Sudanese who have massed in the capital, Khartoum, and other cities in recent weeks to protest the military’s dominance.
The protests have grown increasingly bloody. On Wednesday, security forces killed 17 protesters in Khartoum, most of them shot dead, bringing the toll from weeks of unrest to 40 dead and hundreds wounded, according to Sudan’s largest doctors’ group.
By Sunday afternoon, some protesters had gathered at the gates of the presidential palace where Mr. Hamdok and military leaders were gathered, according to images broadcast on Al Jazeera.
The deal was announced on Sunday morning by the leader of the Umma party, Sudan’s largest. But in a mark of the rapidly changing situation, his own party disavowed the deal hours later.
The deal was also rejected by the Forces of Freedom and Change, Sudan’s coalition of civil society and political groups, which said that it could not accept any compromise with the military, signaling how hard it may be for the agreement to gain wide acceptance.
“There is no negotiation, no partnership and no legitimacy for the revolutionaries,” the coalition group said in a statement on social media.
Mr. Hamdok became prime minister in 2019 following tumultuous protests that ousted Sudan’s longtime dictator, Omar Hassan al-Bashir. He took the post as part of a power-sharing agreement between civilian and military leaders that was supposed to lead to democratic elections.
General al-Burhan has come under tremendous pressure from the United States and other Western countries to reverse the coup. Their pressure has included freezing aid to Sudan, which is in the throes of a deep economic crisis, and halting debt relief programs worth up to $50 billion.
But the military appears determined to ensure that it holds the balance of power in Sudan, even if a transition to democracy gets back on track and elections can be held, as planned, in late 2023 or early 2024.