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, setting off street celebrations by thousands of people.
The two sides, which have held talks in Khartoum for the past two days, agreed to "establish a sovereign council by rotation between the military and civilians for a period of three years or slightly more," African Union mediator Mohamed Hassan Lebatt said at a news conference.
They also agreed to form an independent technocratic government and to launch a transparent, independent investigation into violent events in recent weeks.
The two sides agreed to postpone the establishment of a legislative council.
They had previously agreed that the Forces for Freedom and Change (FFC) coalition would take two-thirds of a legislative council's seats before security forces crushed a sit-in protest on June 3, killing dozens, and talks collapsed
The streets of Omdurman, Khartoum's twin city across the Nile River, erupted in celebration when the news broke, a Reuters witness said. Thousands of people of all ages took to the streets, chanting "Civilian! Civilian! Civilian!"
Young men banged drums, people honked their car horns, and women carrying Sudanese flags ululated in jubilation.
"This agreement opens the way for the formation of the institutions of the transitional authority, and we hope that this is the beginning of a new era," said Omar al-Degair, a leader of the FFC.
"We would like to reassure all political forces, armed movements and all those who participated in the change from young men and women that this agreement will be comprehensive and will not exclude anyone," said General Mohamed Hamdan Dagalo, deputy head of the Transitional Military Council.
"We thank the African and Ethiopian mediators for their efforts and patience. We also thank our brothers in the Forces for Freedom and Change for the good spirit," said Dagalo, who heads the Rapid Support Forces accused by the FFC of crushing the sit-in.
Opposition medics say more than 100 people were killed in the dispersal and subsequent violence. The government put the death toll at 62.