News of the deal, which one analyst said followed regional and international pressure on both sides, touched off street celebrations in the capital of Khartoum with hundreds dancing and waving Sudan's flag as drivers honked their horns. The crisis has gripped Sudan ever since the military ousted longtime autocrat Omar el-Bashir in April.
The sides agreed to form a joint military and civilian sovereign council to lead the country during a transition period of three years and three months, said a statement by the Sudanese Professionals' Association, which has spearheaded the protests. The joint council had been a sticking point in the negotiations.
The council will include five civilians representing the protest movement and five military members. An 11th seat will go to a civilian chosen by both sides. A military member will preside over the council for the first 21 months, followed by a civilian member after that, according to the statement.
That suggested a significant concession by pro-democracy forces, which had insisted that the sovereign council have only a civilian president. But the deal also secured a key demand by protest leaders: that they select the members of a technocratic Cabinet to be formed independently from the generals.
The creation of a legislative council will be postponed for three months, during which time the sovereign council will make the nation's laws. "Today, our revolution has won and our victory shines," the SPA said in the statement, which was posted on its Facebook page.
The generals also hailed the deal, with the military-controlled Al-Sudan TV channel playing national songs and rerunning excerpts of the news conference by both sides announcing the agreement, with the caption: "Congratulations to the Sudanese people."
"This deal will be comprehensive and will not exclude anyone and will meet the ambitions of the Sudanese people and their victorious revolution," said Gen. Mohamed Hamdan Dagalo, the deputy chief of the ruling military council, speaking at the news conference with protest leaders and African mediators.
The talks had collapsed when security forces razed a protest camp outside the military headquarters in Khartoum on June 3, and protest leaders said more than 100 people have been killed since then. In the ensuing weeks, protesters stayed in the streets, demanding that the generals hand power to civilian leadership.
Omer El-Digair, a leader of the Forces for the Declaration of Freedom and Change, a coalition representing the protesters, said they hoped that forming the transitional institutions "marks the beginning of a new era."
"We hope it is an era where we can shut off the sound of pistols and destroy for good prisons of arbitrary detention," he said at the news conference. Tarek Abdel Meguid, another FDFC leader, told The Associated Press that pro-democracy leaders had to make concessions to avoid further bloodshed.
"I am not fully satisfied but it is a step forward to bring peace to our people," Abdel Meguid said. "We had a civilian revolution, and the very idea of power sharing with the military was already rejected by the Sudanese people, but this is what the balance of power dictated."
Khaled Omar, a protest leader, told reporters in Khartoum that the deal was only "a first step." "Power transfer to a civilian transitional authority ... means that the revolution has put it feet (on track) to achieve its principal goals," he said. Omar added that the FDFC does not seek revenge but wants "to achieve a comprehensive national reconciliation."
U.N. Secretary-General Antonio Guterres hailed the deal and urged all sides to "ensure the timely, inclusive, and transparent implementation of the agreement and resolve any outstanding issues through dialogue." Guterres also congratulated the African Union and Ethiopia on their efforts to bring the parties back to the negotiating table.
The negotiations had resumed this week after tens of thousands of people flooded the streets of Sudan's main cities last weekend in the biggest demonstrations since the sit-in camp was razed. At least 11 people were killed in clashes with security forces, according to protest organizers.
Amani el-Taweel, a Sudan expert at Egypt's Al-Ahram Center for Political and Strategic Studies, said regional and international pressures on both parties were the main reason the agreement was reached.
"Sudan has a sensitive geopolitical location, and leaving things as they were would have led to violence, which could undermine regional stability and lead to more terrorism," she said. Also as part of the deal, both sides agreed to launch "a national independent investigation" into the killing of protesters since al-Bashir was ousted.
The New York-based Physicians for Human Rights voiced "cautious optimism" about the agreement and urged an "independent, impartial, international" investigation into the crackdown against protesters. The lawmaking sovereign council could be "a bone of contention," el-Taweel said, "because each of the two parties will seek to maximize its political weight through the laws that will be passed."