Mr. Hamdok was restored to power a month ago after being deposed in a coup, but he was never able to gain control of the fractious country.
NAIROBI, Kenya — Sudan’s prime minister, who was ousted in a military coup but reinstated over a month ago, resigned on Sunday, in the latest upheaval to disrupt the country’s shaky transition to democracy from dictatorship.
The decision by Prime Minister Abdalla Hamdok came as widespread protests gripped the northeast African nation.
Protesters denounced not just the coup that unseated Mr. Hamdok in October but also the deal that returned him to power in November. Opposition political groups and other major political forces rejected it as an unacceptable concession to the military, which has controlled Sudan for most of its history since it became an independent state more than six decades ago.
In a televised address on Sunday evening, Mr. Hamdok said that repeated mediation attempts had failed in recent days and that the country needed to engage in a new dialogue to to chart a path toward a democratic, civilian state.
His speech came just hours after security forces killed three protesters, according to the pro-democracy Central Committee of Sudan Doctors, pushing the total number of people killed in the two months since the coup to 57.
For weeks, amid speculation that the prime minister might step down, local and international leaders pressed Mr. Hamdok to hold fast.
But in the end, it did not work.
“I tried as much as I could to avoid our country from sliding into disaster,” Mr. Hamdok said as he announced his resignation. “But despite my efforts to achieve the desired and necessary consensus to give citizens security, peace, justice and to stop bloodshed, that did not happen.”
Months of turmoil have threatened to upend hopes for establishing a democracy in Sudan that were born after the 2019 ouster of the country’s longtime dictator, Omar Hassan al-Bashir. The political instability has been compounded by other challenges, including dire economic problems and fresh violence in the restive Darfur region in western Sudan.
Mr. Hamdok was removed from office in a coup on Oct. 25, then returned to office in late November after four weeks of house arrest. He was reinstated only after he signed a new power-sharing agreement with the military leaders who had deposed him in the first place.
The occasion was marked by a televised ceremony in the presidential palace, with the prime minister appearing alongside Lt. Gen. Abdel Fattah al-Burhan, the army chief who ousted him and, at one point, detained him in his own residence.
The two men signed a 14-point agreement which they cast as an important step forward. It included commitments to release all political detainees and to preserve the nation’s path toward democracy.
The hope was that Mr. Hamdok’s return to office might end the protests that followed the coup and the brutal reprisals by the security forces. But it did not turn out that way.
Members of Sudan’s largest political organization, the Umma party, rejected the deal. So did some members of the Forces of Freedom and Change, a civilian coalition that shared power with the military until the coup.
The agreement also did not sit well with ordinary citizens. Jeering protesters gathered outside the presidential palace in Khartoum and elsewhere in the country — including on Sunday, the day Mr. Hamdok resigned. They called for the coup leaders to be prosecuted.
Mr. Hamdok, in particular, was accused of providing a fig leaf that allowed the military to continue dominating the political sphere.
Security officers have responded to the demonstrations with heavy force, lobbing tear gas and shooting rubber and live bullets, according to activists and protesters. Hundreds of people have been injured nationwide.
The United Nations human rights office says 13 women and girls have accused the security forces of sexual violence and has called for “a prompt, independent and thorough investigation.” The United States, the European Union and Canada, among others, last month condemned “the use of sexual and gender-based violence as a weapon to drive women away from demonstrations and silence women’s voices.”
Off the political stage, other events have pushed Sudan toward the breaking point. In recent weeks, dozens of people have been killed and their villages burned in violence between herders and farmers in West Darfur state, the United Nations said.
And Sudan’s economy is teetering, with pandemic-related shocks and closings contributing to growing unemployment and rising food prices, according to the World Bank.
That is one area that many Sudanese hoped Mr. Hamdok, a British-educated economist who once worked for the United Nations, would fix, when he was appointed prime minister in 2019 following the tumultuous protests that led to the ouster of Mr. al-Bashir.
Under an earlier civilian-military power-sharing agreement reached then, Mr. Hamdok was named to lead Sudan through a transitional period of three years, with the goal of holding free elections.
His government succeeded in a number of ways, by broadening personal freedoms, banning female genital mutilation, signing a deal with rebel groups and helping to get Sudan removed from a U.S. list of state sponsors of terrorism.
“I have had the honor of serving my countrymen for more than two years,” Mr. Hamdok said Sunday, “and during this period, I have sometimes done well, and I have sometimes failed.”
The civilian-military coalition was fraught, in part because the generals worried that their privileges, long jealously guarded, might evaporate. With Mr. Hamdok’s resignation, protests are likely to continue, analysts said, intensifying pressure against the military. That has the potential to push members of the armed groups to abandon their deal with the government, further undermining the legitimacy of General al-Burhan and his allies.
“The option of a civilian-military partnership is getting bleaker by the day,” said Jihad Mashamoun, a Sudanese researcher and analyst.
To complete the country’s transition to democracy, Mr. Hamdok said Sunday, it is paramount to open a dialogue that will bring all Sudanese people to the table.
“Our country is going through a dangerous turning point that may threaten its entire survival if it is not remedied soon,” he said.