Sudan's military leaders have reached an agreement with the opposition alliance to share power before holding elections, mediators say.
The two sides agreed to rotate control of the sovereign council - the top tier of power where both want a majority.
They have also pledged to form an independent technocratic government and to investigate the violence of recent weeks, African Union (AU) said.
News of the agreement reportedly sparked frenzied street celebrations.
Sudan has been in turmoil since the military ousted President Omar al-Bashir in April.
That followed a popular uprising against Mr Bashir, who seized power in a coup in June 1989.
Just days before the three-year transitional deal was announced, vast crowds took to the streets to demand that the ruling military council hand power to a civilian-led administration.
Seven people were killed and 181 were hurt in clashes that followed, state media reported.
The latest round of talks took place in the capital, Khartoum, earlier this week and were heavily mediated by the Ethiopian prime minister and members of the pan-African AU.
What has been agreed?
"The two sides agreed on establishing a sovereign council with a rotating military and civilian [presidency] for a period of three years or a little more," AU mediator Mohamed Hassan Lebatt told reporters early on Friday.
Elections will then be held once this transition period ends.
Both sides also "agreed to have a detailed, transparent, national, independent investigation into all the regrettable violent incidents that the country faced in recent weeks," he added.
They have also agreed to postpone the establishment of a legislative council.
"We hope that this is the beginning of a new era," Omar al-Degair, a leader of the opposition Forces for Freedom and Change (FFC), said after the announcement.
Deputy head of Transitional Military Council (TMC), Mr Mohamed Hamdan Dagalo, said: "This agreement will be comprehensive and will not exclude anyone.
"We thank the African and Ethiopian mediators for their efforts and patience."
What is the background?
Last month, representatives of the protesters were in talks with the military over who would take control of Sudan.
But negotiations collapsed when a military crackdown on 3 June left dozens of protesters dead.
The army said it had scrapped all agreements with the opposition, and that elections would be held within nine months. But the protest movement insisted a transition period of at least three years was needed to ensure any elections are free and fair.
When talks broke down, Ethiopian Prime Minister Abiy Ahmed flew to Sudan to try to broker a new agreement between the two sides.
After days of talks, his special envoy, Mahmoud Dirir, then announced that protest leaders had agreed to suspend widespread strikes and return to the negotiating table.
Compiled by Olalekan Adeleye
BBC