Sudan’s newly reinstated prime minister disclosed that he compromised in a deal with the country’s military in order to “avoid bloodshed” and a civil war.

Prime Minister Abdalla Hamdok and other ministers were detained during a military coup last month that saw the country’s power-sharing government dissolved.

More than 40 people have since been killed in protests.

But the country’s military chief, reinstated Hamdok on Sunday as part of a deal between the military and civilian leadership in the country.

The deal, signed on live television, calls for the release of all political prisoners arrested by security forces following the coup.

Under the deal, Hamdok again becomes leader of the transitional government, which was first established after strongman President Omar Al-Bashir was ousted in 2019.

The Council of Ministers, which was dissolved on October 25, will be restored and the civilian and military leadership will share power.

The constitution will be amended to outline the partnership between civilians and the military in the transitional government.