Sudan’s military council and representatives of the opposition coalition on Sunday signed a document paving the way for a transitional government.
The constitutional declaration was reached almost four months after the military removed authoritarian former president Omar Al Bashir from power and eight months since street protests began against his 29-year rule.
The document is intended to be a prelude to stable democratic rule in Sudan, ending a cycle of military dictatorships and dysfunctional civilian governments that have defined the country in the 63 years since independence.
There are still daunting challenges that include ending armed conflicts in Sudan's west and south, a battered economy, bringing together different ethnic and religious groups and dismantling a corrupt "deep state" run by a political elite.
Sudan's future still remains uncertain. There have been reports of at least two military coup attempts in recent months, which ruling generals blamed on senior officers loyal to Mr Al Bashir's regime.
But the signing of the power-sharing pact is an encouraging sign as Sudan begins to shake off Mr Al Bashir's legacy of corrupt rule and tactics that pitted the Sudanese against each other.
"We entered the negotiations as partners and emerged as one team," said Gen Mohamed Dagalo, deputy chairman of the ruling Transitional Military Council, who signed the document.
"The national will has triumphed. It's a win."
A formal signing in front of foreign dignitaries is due to take place on August 17, the date on which Mr Al Bashir is to go on trial for corruption charges.
Mohammed Abdel Aziz, a prominent member of the coalition of political parties and trade unions that represented protesters in negotiations with the military, said signing the document was a “key step towards realising the goals of the revolution”.
The details of the document show a significant level of flexibility from the ruling generals and may usher in an era of harmony between Sudan's pro-democracy movement and the military.
Six civilians will serve on an 11-seat sovereign council that will act as a collective presidency. The remaining five will come from the military.
A member of the military will lead the council for the next 21 months and a civilian will lead it for the 18 months after.
The council members and its composition are due to be announced on August 18.
A government of non-partisan technocrats will be led and made up by civilians selected by the Forces of Freedom and Change, the opposition coalition. Only the defence and interior ministers will be chosen by the military.
Civilians will also take 201 of the 300 seats in a legislative council, with the remainder going to political groups that are not members of the coalition.
The document also discusses bringing to account anyone found guilty of crimes against the people during Mr Al Bashir's rule.
It would be a potentially explosive process that could spark friction or conflict between the protest movement and the military.
Militias aligned to the government are widely blamed for the outbreak of violence on June 3, which led to deadly shootings in the capital Khartoum and elsewhere.
The paramilitary Rapid Support Forces fought rebels in the western Darfur region in the 2000s and is accused of committing atrocities against civilians there.
The constitutional document also stipulates measures to bring the militias under the command of the armed forces, a significant step against an outfit considered to have larger resources and better weapons than the army.
The first six months of the transitional period will be focused on peacefully resolving conflicts in western and southern Sudan, where the militias are fighting on behalf of the government and are blamed for continuing abuses.
Two of Khartoum's main Arab backers, the UAE and Egypt, welcomed Sunday's agreement, stressing that stability in Sudan was key to the region's security.
Dr Anwar Gargash, UAE Minister of State for Foreign Affairs, tweeted that the agreement was the start of a new era in Sudan's political history, turning the page on the rule of Mr Al Bashir and the Muslim Brotherhood.