Sudan's peace agreement signed last week finally promises to end the devastating wars in Darfur, South Kordofan and Blue Nile that have cost hundreds of thousands of lives, but as Alex de Waal and Edward Thomas explain, it comes with a huge price tag.
The deal was negotiated between the transitional government and a coalition of rebel leaders in South Sudan's capital, Juba.
Its strength is the goodwill on both sides.
Its weakness is that Sudan is trying a bold experiment in democracy in the middle of intersecting crises with practically no international help.
In August 2019, Sudanese military and civilian leaders agreed to cohabit in a transitional government, fulfilling a central demand of the protesters who had overthrown the 30-year dictatorship of President Omar al-Bashir.
A top priority was ending the wars that had long ravaged Sudan's peripheries.
The rebels were confident that those in the civilian cabinet, led by Prime Minister Abdalla Hamdok, were sincere.
They did not trust the generals, especially Lt-Gen Mohamed Hamdan Dagolo, known as "Hemeti", whose paramilitaries had waged terrifying counter-insurgency campaigns.
The agreement was reached after almost a year of peace talks.
The military chairman of the transitional council, Lt-Gen Abdel Fattah al-Burhan and his deputy, Hemeti, need the international legitimacy that would come from a deal.
But their preferred approach was divide-and-rule: offering money and jobs to individual rebel leaders to co-opt them one-by-one.
Decades of this strategy had splintered the rebel forces along ethnic lines.
The largest grouping, the Sudan Revolutionary Front, is a fragile coalition. And although it shares many of the same goals as Khartoum's non-violent protesters, they come from very different backgrounds.
The urban protesters endured decades of surveillance and police repression.
Their leaders are drawn from the professional elite and expected to inherit government, as had happened with the previous "Khartoum Spring" uprisings in 1964 and 1985.
Key dates in Sudan:
- 1956: Sudan becomes independent, 27 years later Islamic law is introduced
- 1989: Omar al-Bashir comes to power after a coup
- 2003: Darfur conflict starts after rebels accuse the government of favouring Arab groups, leading later to International Criminal Court arrest warrants against President Bashir for war crimes, crimes against humanity and genocide
- 2005: Deal signed ending long-running conflict between north and south. It leads to South Sudan's independence six years later
- 2011: Conflict begins in South Kordofan and Blue Nile after rebels who fought alongside the southern Sudanese find themselves in the north after secession
- April 2019: Army ousts President Bashir after months of protests against his rule
- Sept 2019: New government takes office under PM Abdalla Hamdok as part of a three-year power-sharing deal between the military, civilian representatives and protest groups
- August 2020: Sudan's transitional government signs a peace deal with five rebel groups.
The rebels fought bloody wars in the dust and mud of remote peripheries.
They were marginalised by previous governments and do not have experience of civil politics.
So the rebels were slow to trust the urban political class - even though the 2019 revolution offered a once-in-a-lifetime chance to transform Sudan.
The peace agreement brings the rebels into the transitional government.
They have been allocated hundreds of legislative and executive posts, which they will hold until elections take place in three years' time.
Thousands of rebel fighters will be incorporated into the military.
Millions of people displaced by war will be helped to return home.
A reworked federal system will give more power to local administrations.
There is to be land reform and courts to bring war crimes suspects to justice.
These prescriptions for peace are not new.
Deals with similar formulae have fallen apart over the last 15 years.
This time it is different: it is a Sudanese deal, negotiated by the Sudanese without external deadlines or arm-twisting.
Both sides know that it must work or the democratic experiment will fail.
There are two holdout rebel groups, but it is likely that they will come around.
You may also be interested in:
One leader who has not yet signed is Abdel Aziz al-Hilu of the Sudan People's Liberation Movement-North in South Kordofan's Nuba Mountains.
He is principled and stubborn and his demands - secularism and Nuba's right of self-determination - do not allow for much compromise.
But Prime Minister Hamdok respects Mr Hilu and they have vowed to keep on talking.
The other holdout is Abdel Wahid al-Nur of the Sudan Liberation Movement (SLM) in Darfur.
He is a serial naysayer.
But the deal meets his substantive demands, and if it is implemented, he will not be able to sustain his objections.
Terror list hurdle
But this is where the real danger lies.
Sudan is in economic meltdown, set in motion by the Bashir government's mismanagement and exacerbated by the Covid-19 pandemic and now by floods.
There is one essential thing needed to stabilise the economy.
The US designated Sudan as a "state sponsor of terror" back in 1993 - and until it removes that status, crippling economic sanctions remain.
Sudan stopped supporting "terrorists" 20 years ago but Washington DC wants something in return, and when US Secretary of State Mike Pompeo briefly visited Khartoum last month, top of his agenda was pressing Sudan to recognise Israel.
Mr Hamdok replied that only an elected government would have the mandate to do that.
The peace agreement comes with a big price tag.
It promises development funds for rebuilding the devastated rural areas and helping displaced people return home.
It promises expanded health services and schools and universities.
Integrating the rebels into a new national army will cost money.
And that is all in addition to the emergency funds needed to stabilise the economy and stave off a looming humanitarian crisis.
Until Washington officially recognises that Sudan is not a "sponsor of terror", there is no debt relief and little foreign investment.
This leaves Sudan's financial lifeline in the hands of Saudi Arabia and the United Arab Emirates, which give cash-in-hand to their favourite military powerbrokers such as Gen Burhan and Hemeti.
The Sudanese have overthrown a dictator and sealed a peace deal, by themselves and without international support.
They feel the least that the rest of the world can do is to give them a chance.
Edward Thomas is a fellow of the Rift Valley Institute in Kenya and Alex de Waal is the executive director of the World Peace Foundation at the Fletcher School of Law and Diplomacy at Tufts University in the US.