Sudan’s military has reinstated Prime Minister Abdalla Hamdok and promised to release all political detainees after weeks of deadly unrest triggered by a coup. However, large crowds took to the streets to reject any deal involving the army.

Under an agreement signed with military leader General Abdel Fattah al-Burhan, Hamdok, first appointed after the overthrow of autocrat Omar al-Bashir in a 2019 uprising, will lead a civilian government of technocrats for a transitional period.

The deal faces opposition from pro-democracy groups that have demanded full civilian rule since Bashir’s ouster and have been angered by the deaths of dozens of protesters since the Oct. 25 coup.

A hero for the protest movement, Hamdok quickly became the villain for some.

“Hamdok has sold the revolution,” protesters chanted after the deal was announced. The Sudanese Professionals Association (SPA), a leading protest group, called it “treacherous”.

Thousands joined scheduled rallies in the capital, Khartoum and its twin cities of Omdurman and Bahri. Security forces fired bullets and tear gas to disperse them, witnesses said. A 16-year-old protester in Omdurman died from a bullet wound, the Central Committee of Sudanese Doctors said.

“Hamdok has disappointed us. Our only option is the street,” said Omar Ibrahim, a 26-year-old protester in Khartoum.

Hamdok said he agreed to the deal to prevent more casualties.

The United States, Britain, Norway, the European Union, Canada and Switzerland welcomed the reinstatement of Hamdok and, in a joint statement, urged the release of other political detainees. The United Nations also welcomed Sunday’s deal.

Western powers had condemned last month’s takeover and suspended economic assistance to Sudan, which has been trying to recover from a deep economic crisis.

The coup triggered mass demonstrations against the military, and medics aligned with the protest movement say security forces have killed 41 civilians in increasingly violent crackdowns.