Sudan’s opposition and military leaders reached a power-sharing deal that would move the country toward elections in just over three years, a mediator from the African Union announced Friday in the predawn hours.

The deal, while not finalized, would keep the leaders of a military council that runs Sudan’s government in charge for the next 21 months, after which a civilian would take control for 18 months before holding elections.

Street protests have rocked Sudan since December, precipitating the overthrow of President Omar Hassan al-Bashir in April by former military allies. He had ruled the country for nearly 30 years, and his autocratic government repressed many civil rights, carried out brutal campaigns against ethnic minorities, and could not stop the rising cost of basics such as bread and fuel.

The military council that took his place has been seen by many protesters as an extension of Bashir’s regime. They have clamped down on communications and public gatherings, and the Internet has been shut off for a month. On June 3, police and paramilitary troops in Khartoum, Sudan’s capital, violently dispersed a vast sit-in and killed more than 100 people, according to physicians affiliated with the protests.

On Sunday, protesters filled the streets of many cities in their first show of strength since the sit-in’s dispersal. Seven people were killed and nearly 200 wounded.

Friday’s deal stipulates that no military figure found to have been involved in those and other violent acts will be allowed to participate in the government and that independent investigations into the violence will be initiated.

The agreement does not appear to exclude Gen. Mohamed Hamdan Dagalo, known as Hemedti, who leads the paramilitary Rapid Support Forces, which protest leaders have cited as the perpetrator of most attacks against them.

“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,” he said at the news conference announcing the deal.

The Internet remained shut off across Sudan on Friday. Nothing was said at the news conference about the many issues that have driven the protests, such as the inclusion of women in government and increased freedom for news organizations.