Sudan's pro-democracy movement signed a final power-sharing agreement with the ruling military council on Saturday at a ceremony in the capital, Khartoum.

The deal paves the way for a transition to civilian-led government following the military overthrow of President Omar al-Bashir in April.

The signing capped weeks of tortuous negotiations between the military and protest leaders. Earlier this month, the two sides initialled a constitutional document in the wake of international pressure and amid growing concerns the political crisis could ignite civil war.

Gen. Abdel-Fattah Burhan, head of the military council, called the signing a "victorious and historic day for our nation."

"The revolution has achieved its goals," he said, vowing the military would guarantee the transition to civilian rule.

Sudanese protesters from the city of Atbara arrive in Khartoum on Saturday to celebrate transition to civilian rule. (Ahmed Mustafa/AFP/Getty Images)

Protest leader Mohammed Naji al-Asam said the two sides have ushered in a "new page" in Sudan's history after three decades of "repression and corruption."

The two sides appeared to agree on the soundness of a deal that came about in part because of international pressure. Ethiopia and the African Union co-led mediation efforts between the military and protesters, and many regional leaders and international envoys attended Saturday's ceremony, including Ethiopian Prime Minister Abiy Ahmed.

The protest organizers planned celebrations in Khartoum and elsewhere across the country. Railway workers and other protesters had travelled to the capital Friday by train from Atbara, the northern transport hub where the uprising began in December.

The power-sharing deal creates a joint military and civilian sovereign council to rule for a little over three years until elections can be held. A military leader would head the 11-member council for the first 21 months, followed by a civilian leader for the next 18.

Lt. Gen. Shams el-Din Kabashi, spokesman for the military council, said Burhan would be the initial leader

Cabinet, legislative body

The agreement would also establish a cabinet appointed by the activists, as well as a legislative body to be assembled within three months. The protest coalition is to have a majority in that body, as nominated by the Forces for Declaration of Freedom, a coalition of opposition parties and movements representing the protesters.

The FDFC has nominated a well-known economist, Abdalla Hamdok, to lead the government during the transition. He served as the deputy executive secretary of the United Nations Economic Commission for Africa since November 2011, and has yet to be confirmed by the sovereign council. The council's members are to be announced on Sunday, after which the ruling military council will immediately be disbanded.

The deal has been criticized by the Sudan Revolutionary Front, an alliance of the largest rebel groups in Darfur. The rebels have stressed to protest leaders that the agreement did not include "basic principles" to achieve peace in Sudan. The deal calls for the government to reach a peace agreement with the rebels within six months.

The rebel alliance, which is part of the FDFC, wanted to include a peace document agreed with the protest movement into the power-sharing deal. The rebel leaders have engaged in talks with other protest leaders to settle the disputed points.

The military overthrew al-Bashir following months of protests against his three-decade-long authoritarian rule. The protesters then remained in the streets, demanding a rapid transition to civilian leadership.

The two sides came under renewed pressure to reach an accord after security forces opened fire on student protesters in the city of Obeid on Aug. 1, leaving six people dead. At least nine troops from the paramilitary Rapid Support forces were arrested over the killings.

In June, security forces violently dispersed the protesters' main sit-in outside the military headquarters in Khartoum, killing dozens of people and plunging the fragile transition into crisis. The deal includes the establishment of an independent investigation into the crackdown.