A protester flashes the victory sign while holding her child in a street leading to a sit-in outside the Sudanese military headquarters in Khartoum, Sudan on May 14. (AP)

SUDAN HAS taken a hopeful step forward. The military is negotiating with protest leaders about the structure of a new civilian government to replace Omar Hassan al-Bashir, the dictator ousted in April after three decades of despotic rule. No doubt there will be setbacks, such as the shooting incident Monday in which four people were killed and dozens wounded. But the announcement of a basic agreement on a three-year transition should be welcomed after so many years of despair and misrule.

When the military decided to dump Mr. Bashir in the face of mass demonstrations, there was serious concern that the generals would hold on to the levers of power, an ambition encouraged by a generous $500 million infusion from Saudi Arabia and the United Arab Emirates. If the Transitional Military Council in Khartoum, a coterie of military and security forces left over from the Bashir era, fails to relinquish control, it would be the worst possible outcome of the mass protests that have roiled the country since December.

The protests broke out over rising prices for bread and other necessities and spread into the new year. Mr. Bashir tried to bottle them up with a state of emergency, but demonstrators camped out in front of military headquarters and would not be silenced. On April 11, Mr. Bashir was removed from power and later held in a high-security prison, and on Monday, he was charged with incitement and involvement in the killing of demonstrators. We hope Sudan will have the courage to prosecute Mr. Bashir for crimes against humanity in the genocidal campaign against the people of Darfur or will hand him over to the International Criminal Court, which long ago indicted him.

With good reason, protest leaders have demanded that a new civilian government with democratic principles take over. The gritty determination of the demonstrators has forced the military into talks that seem to be bearing fruit, including the promising agreement on a three-year transition. The generals have also tentatively agreed to give the opposition alliance two-thirds of the seats on a 300-seat transitional legislative council, and the remaining seats would go to other opposition parties. What’s not yet clear is the composition of an 11-member sovereign council, which would be the highest authority in the land. The demonstrators and the military have each insisted on having a majority. The civilians should hold fast for control of this council to ensure that real change and, eventually, democracy are able to flower.

The hopes for freedom kindled in the Arab Spring of 2011 remain largely unfulfilled. In places, such as Egypt and Saudi Arabia, tyranny is worse than ever. Sudan’s protest movement has been inchoate and forged by necessity, and it embarks on a new era with precious little experience in governing after 30 years of the Bashir dictatorship. But if Sudan can break with that legacy, it will prove immensely valuable for its people and the Arab world around it — especially those suffering under the regimes that have been trying to save Sudan for dictatorship.