According to the deal, signed Sunday, the military will also release government officials and politicians arrested since the coup.
The country’s top general, Abdel Fattah Burhan, said in televised statements that Hamdok will lead an independent technocratic Cabinet until elections can be held. It remains unclear how much power the government would hold. It would still remain under military oversight.
The coup, more than two years after a popular uprising forced the removal of longtime autocrat Omar al-Bashir and his Islamist government, has drawn international criticism.
Sudanese have been taking to the streets in masses since the military takeover, which upended the country’s fragile transition to democracy. The agreement comes just days after doctors said at least 15 people were killed by live fire during anti-coup demonstrations. Hamdok has been held under house arrest by military leaders for weeks.
Earlier, military and government officials who spoke of the deal said it also foresaw the release of government officials and politicians arrested since the Oct. 25 coup. The largest of the political parties said to be included in the deal, the Umma Party, had issued a statement implying that it did not sign off on the deal.
Download the NBC News app for breaking news and politics
The officials, who spoke on condition of anonymity because they weren’t authorized to release the information, said that the U.N., the U.S. and others had played “crucial roles” in crafting the agreement.
The United States, its allies and the United Nations have condemned the use of excessive force against anti-coup protesters.
Meanwhile, thousands took to the streets in the capital of Khartoum on Sunday to denounce the coup and demand the immediate transfer of power to civilians. Protesters waved the Sudanese flag and chanted “Power is to the people! The military are to stay in the barracks.”