People celebrate after Sudan's ruling military council and a coalition of opposition and protest groups reached an agreement to share power during a transition period leading to elections, in Omdurman, Sudan, in image obtained from social media on July 5, 2019 Sudan Congress Party via REUTERS

Khartoum, Sudan -- Leaders of Sudan's pro-democracy movement welcomed on Friday a power-sharing agreement with the ruling military council as a victory for their "revolution," raising hopes for an end to the three-month standoff with the generals and to deadly violence.

"Today, our revolution has won and our victory shines," read a statement posted early Friday on the Facebook page of the Sudanese Professionals' Association, which has spearheaded the protests.

The two sides held talks in Khartoum for two days, the Reuters news agency reports.

Get Breaking News Delivered to Your Inbox

The emerging deal could break the political impasse that has gripped the country since the military ousted the longtime autocrat Omar al-Bashir in April, amid an uprising against his rule.

In the following months, protesters stayed in the streets demanding the generals hand over power to a civilian leadership. Talks collapsed when security forces razed a protest camp outside the military headquarters in Khartoum on June 3 leaving more than a hundred dead, according to protesters.

The African Union and Ethiopia made intense efforts to bring the generals and the protesters back to the negotiating table.

Negotiations resumed earlier this week, after tens of thousands of demonstrators flooded the streets of Sudan's main cities over the weekend in the biggest show of numbers since the razing of the protesters' sit-in camp. At least 11 people were killed in clashes with security forces, according to protest organizers.

When news of the deal broke around dawn on Friday, hundreds of protesters returned to the streets dancing, singing and waving Sudanese flags, while passing drivers honked.

The military-controlled Al-Sudan television channel played national songs. It also reran excerpts of the press conference announcing the agreement, held jointly by protest and military leaders, which it subtitled "Congratulations to the Sudanese people."

"We hope that the formation of transitional institutions marks the beginning of a new era," said Omer El-Digair, a leader of the Forces for the Declaration of Freedom and Change, a political coalition representing the protesters, at the joint press conference with the military and African mediators following the conclusion of the deal. "We hope it is an era where we can shut off the sound of pistols and destroy for good prisons of arbitrary detention."

"This agreement is comprehensive and does not exclude anyone," Reuters quotes General Mohamed Hamdan Dagalo, deputy head of the Transitional Military Council as saying.

The two parties agreed to form a joint sovereign council to lead the country during a transitional period of three years and three months, said the SPA statement. Reuters said elections are supposed to follow.

The council will include five civilians representing the protest movement and five military members. An eleventh seat will go to a civilian chosen by both parties.

A military member will preside over the council during the first 21 months, followed by a civilian member after, according to the statement.

This suggests a significant concession on the part of pro-democracy forces, which had insisted that the sovereign council have only a civilian president. However, the deal did secure another key demand, that protest leaders select the members of a technocratic Cabinet to be formed independently from the generals.

The two parties also agreed to launch "a national independent investigation" into the killings of protesters since al-Bashir was ousted on April 11, according to the statement.