Sudan’s opposition and ruling military junta agreed to a political power-sharing deal early on Friday morning, designed to end months of political unrest that toppled the country’s longtime dictator and left scores of civilians dead.

Word of the deal sparked celebrations in the capital, Khartoum.

“It is a turning point that will usher in a new dawn in the country,” opposition Sudanese Congress Party leader Omar al-Degair was quoted as saying by state radio.

Under the terms of the deal, Sudan’s Transitional Military Council and the opposition Freedom and Change will contribute equally to a 10-person council that will rule over the country, with each side rotating in the leadership for three years or longer before the end of elections.

They also agreed to a joint investigation of the 3 June massacre of peaceful opposition protesters at the hands of shadowy pro-regime militiamen.

Military HQ occupied by anti-government protesters in Sudan Show all 20 1 /20 Military HQ occupied by anti-government protesters in Sudan Military HQ occupied by anti-government protesters in Sudan Protesters rally outside the military headquarters in Khartoum to demand that President Omar al-Bashir step down Reuters Military HQ occupied by anti-government protesters in Sudan Alaa Salah leads the protest against President Omar al-Bashir Lana Haroun/Twitter Military HQ occupied by anti-government protesters in Sudan Protesters run from tear gas deployed by security forces as they take part in a demonstration to demand the departure of the Sudanese government EPA Military HQ occupied by anti-government protesters in Sudan Sudanese protesters rally outside the military headquarters in Khartoum on April 8 Sudan Congress Party Military HQ occupied by anti-government protesters in Sudan Sudanese protesters rally outside the military headquarters in Khartoum on April 10 Reuters Military HQ occupied by anti-government protesters in Sudan Alaa Salah, a Sudanese woman propelled to internet fame earlier this week after clips went viral of her leading powerful protest chants against President Omar al-Bashir, addresses protesters outside of the military headquarters in Khartoum AFP/Getty Military HQ occupied by anti-government protesters in Sudan Sudanese protesters march on the military headquarters in Khartoum on April 8 AFP/Getty Military HQ occupied by anti-government protesters in Sudan Demonstrators attend a protest rally demanding Sudanese President Omar Al-Bashir to step down outside Defence Ministry in Khartoum, Sudan April 10, 2019. REUTERS/Stringer NO RESALES. NO ARCHIVES Reuters Military HQ occupied by anti-government protesters in Sudan Sudanese protesters pray as they rally outside the military headquarters in Khartoum AFP/Getty Military HQ occupied by anti-government protesters in Sudan Sudanese protesters chant slogans as they march in protest against President Omar al-Bashir Reuters Military HQ occupied by anti-government protesters in Sudan Sudanese protesters rally outside the military headquarters in Khartoum on April 8 AFP/Getty Military HQ occupied by anti-government protesters in Sudan Sudanese protesters rally outside the military headquarters in Khartoum on April 8 AFP/Getty Military HQ occupied by anti-government protesters in Sudan Sudanese protesters climb onto a military vehicle beside soldiers during protests in Khartoum AFP/Getty Military HQ occupied by anti-government protesters in Sudan Security forces deploy tear gas to disperse protesters against the Sudanese government Reuters Military HQ occupied by anti-government protesters in Sudan Sudanese protesters rally outside the military headquarters in Khartoum on April 8 AFP/Getty Military HQ occupied by anti-government protesters in Sudan A wounded protester rests during a demonstration in front of the military headquarters in Khartoum AFP/Getty Military HQ occupied by anti-government protesters in Sudan A Sudanese protester shows bullet cartridges as protesters gather in Khartoum AFP/Getty Military HQ occupied by anti-government protesters in Sudan Protesters march on the military headquarters in Khartoum Sudan Congress Party Military HQ occupied by anti-government protesters in Sudan Sudanese protesters march on the defence ministry in Khartoum to demand that President Omar al-Bashir step down Reuters Military HQ occupied by anti-government protesters in Sudan A Sudanese protester picks up waste during a demonstration in front of the military headquarters in Khartoum AFP/Getty

Lawyers for the two sides are writing up the agreement, which will be signed by both sides a few days after it is complete, Siddig Yousif, one of the civilian negotiators, told BBC World Service.

“This is the first step for building a democratic Sudan,” he said.

The deal, brokered by the African Union, leaves a fragmented military backed by regional Arab dictatorships firmly entrenched. But it also dissolves the Transitional Military Council that has been in charge since the toppling of longtime ruler Omar al-Bashir, a military man.

It comes after nearly eight months of protests that began in a rural enclave over bread price rises and culminated in a vast, peaceful movement led by a network of Sudanese lawyers, doctors, engineers and educators.

Sudan has struggled to throw off the yoke of military rulers for decades. But civilian-led administrations were quickly toppled by the armed forces, who have dragged the country into repeated and disastrous civil wars.

Mr Bashir’s militarism cost the country its oil-rich south, which broke away and became the Republic of South Sudan in 2011. The country’s ongoing civil wars in the Darfur region and elsewhere make it one of the largest producers of refugees in the world.

Mr Yousif acknowledged to the BBC that opposition leaders would have to convince hundreds of thousands of activists and protesters that the deal is worthwhile. They defiantly flooded the streets of Khartoum on 30 June in a mass protest against the military, despite the threat of violence by pro-regime gunmen and a clampdown on the internet.

The deal falls short of the demand for an end to the pervasive power of the military rule demanded by opposition activists and ordinary Sudanese. It appears to keep the leader of the junta, a onetime militia commander named Abdel Fattah al-Burhan, firmly in charge of the security apparatuses, which could easily reverse any democratic gains.

The security forces have refused to lift internet restrictions or release hundreds of political prisoners held in jail.

The military will assume leadership of Sudan for the first half of the transition period, yielding power to civilians under the deal after 21 months.

Some are sceptical that Sudan’s armed forces would ever give up the reins of power, or that armed forces’ Egyptian, Saudi, and Emirati patrons would ever allow a civilian-led democratic Arab government to flower on the Red Sea.

“It’s open to question whether the military is ever going to step down,” Joseph Siegle, director of research at the Washington-based Africa Center for Strategic Studies, told The Independent.

“It’s very consistent with Sudanese politics to make promises and concessions and appear moderate at one point, and then as time passes, to renege on that.”

Civilians rushed into hospitals as Sudanese forces violently clear sit-in

But the deal may be the best the civilian activists can hope for. The military, which provides Saudi Arabia and the United Arab Emirates with ground forces for their four-year war against Iranian-backed Houthis in Yemen, has the firm financial and diplomatic support of the Gulf monarchies as well as the dictatorship in neighbouring Egypt.

In a surprise move, the US vocally called out the meddling by its Gulf allies in Sudan. That, along with African Union pressure on Mr Burhan, may have prompted the military to compromise. The country is also in dire economic straits, with foreign debt at $55bn, inflation running at over 70 per cent, and food and fuel prices tripling in recent months. “Since the beginning there are all these fundamental problems that had sparked the protests to begin with,” said Mr Siegle. “The military is not a position to solve them.”

The deal may also provide some breathing space for the civilian protest movement to continue protests and demand further reform, H.A. Hellyer, a Middle East and north Africa specialist at the Atlantic Council and the Royal United Services Institute, told The Independent. “The deal is not what many in the protest movement will have hoped for, while there will also be those who consider it the least bad of all options,” he said.