Following weeks of negotiations and a deadly crackdown last month by security forces, a Sudanese pro-democracy movement and the ruling military council have agreed to a power-sharing deal.

The two groups signed a document early Wednesday during a ceremony in the capital, Khartoum, on early Wednesday, marking an important step in the transition to civilian rule following the ouster of Sudan’s longtime strongman, Omar al-Bashir, after 30 years in power.

The most contentious part of the deal – the division of powers – is still in the works after marathon overnight talks, but it appears the military has the upper hand.

"We are ushering in a new era," said Ibrahim al-Amin, a negotiator for the Forces of the Declaration of Freedom and change, a broad-based coalition including independent professional unions, traditional political parties, and other groups.

"The upcoming government will be a government of all Sudanese, for all citizens ... we have suffered enough from the totalitarian dictatorial regime."

A TIMELINE OF KEY EVENTS IN SUDAN'S UNFINISHED REVOLUTION

In a significant concession by the protesters, who have demanded an immediate transition to civilian rule, the document signed on Wednesday states that a military leader will head a joint 11-member civilian-military sovereign council for 21 months. A civilian leader will then head the council for 18 months while elections are organized.

But negotiators have yet to agree on a division of powers between the sovereign council, the Cabinet and the legislative body, which would be enshrined in the constitutional document. That document, which they hope to adopt in talks scheduled for Friday, would also set the terms of military leaders' potential immunity from prosecution.

"This is the big hurdle. Sudan's future after al-Bashir will be defined by this constitutional declaration," said Rasha Awad, editor of the online Sudanese newspaper Altaghyeer.

The military has said the sovereign council should be able to veto appointments to the Cabinet and Cabinet decisions, something the protesters fear would deprive it of any real power. The protesters have also said that members of the council should be stripped of immunity if they are implicated in last month's crackdown.

SUDAN MILITARY ADMITS SECURITY FORCES COMMITTED 'VIOLATIONS' AFTER PROTESTS TURNED DEADLY

The Communist Party said it and some other factions rejected the deal signed Wednesday because it did not include the immediate handover of power to civilians and did not provide for an international investigation of the violence.

Protest organizers say security forces killed at least 128 people during last month's crackdown. Authorities put the death toll at 61, including three members of the security forces. The two sides have agreed on a Sudanese investigation into the violence, but have yet to outline its scope.

The agreement signed Wednesday at a ceremony broadcast by state TV stems from a meeting last month brokered by the U.S. and Britain, which support the protesters, and Egypt, Saudi Arabia, and the United Arab Emirates, which back the military. The diplomatic push ended weeks of stalemate that had raised fears of further violence or even civil war.

CLICK HERE TO GET THE FOX NEWS APP

The military was represented by Gen. Mohammed Hamdan Dagalo, known as Hemedti, who has consolidated power since al-Bashir's overthrow and whose paramilitary Rapid Support Forces are accused of leading last month's crackdown. He hailed the agreement as a "historic moment in Sudan."

Envoys from Ethiopia and the African Union, who had spearheaded mediation efforts, also praised the agreement at Wednesday's ceremony. The U.S. Embassy in Khartoum welcomed the deal and encouraged both sides to "continue the same spirit of cooperation to conclude a constitutional decree."

The Associated Press contributed to this report.