South Sudan’s leaders have failed their country in its short life. But it is not too late for them to redeem themselves.

Peace agreements, however difficult to conclude, are usually signed with smiles, hopes and even, in South Sudan, with ululations. But the atmosphere was rather different in Juba on Wednesday despite President Salva Kiir signing a deal that in theory ends South Sudan’s devastating twenty month conflict.

President Kiir made it perfectly and painstakingly clear how little faith he had in the agreement sponsored by the Intergovernmental Authority on Development (IGAD) and other international partners (known collectively as IGAD Plus). Salva announced he had serious reservations. In fact, a twelve-page document was handed out to the assembled dignitaries, intended to be an annex to the peace deal, though the US and others quickly made it clear they would not accept any changes to the signed text.

In his speech, the president also talked about “intimidating messages” – without specifying the source – and said these constituted “a designed roadmap for regime change”. The message, then, was clear: Kiir was signing under duress and signing a deal he believes to be an “imposed peace” rather than “a negotiated peace deal for a just and lasting peace”.

In those circumstances, it is perfectly reasonable to wonder how long the deal will hold.

President Kiir and his camp clearly had more to lose than former vice-president Riek Machar, another signatory to the deal. Salva’s group go from controlling the whole government to merely a majority of it – and not even that in Unity, Upper Nile and Jonglei states, where the government will have only 46% of the posts in the state legislature. The rebels will also name the governor in oil-rich Unity and Upper Nile states.

Salva will have to manage the anger of those who will now lose their jobs and of those who felt a deal should not have been signed. Michael Makuei, the information minister and a hardliner, reportedly walked out of the signing ceremony in disgust. The chief of staff of the national army, Paul Malong, did attend the ceremony, and was the subject of intense scrutiny. He, other generals, and Dinka elders were believed to have been against the deal.

Salva’s period of consultations – and even his attempt to annex reservations to the agreement – might be seen as an attempt to overcome the misgivings of the powerful interest groups on his side who were opposed to the deal. But they will not all have been appeased.

The rebels have their divisions too. The recent defection of a dozen generals, led by Peter Gatdet and Gathoth Gatkuoth, highlights the possibility that Riek will not carry all his forces with him. It is not yet clear how many men the disaffected generals can count on. But a meaningful split in the rebel ranks remains a real possibility.

The permanent ceasefire – due to come into effect 72 hours after the signature of the agreement – seems likely to be tested. The arrival of Riek and his new ministers to Juba, in three months time, promises to be another tense day. Will Riek and Salva – and their more belligerent followers – be able to work together?

History suggests they might. After all, Riek came back into the SPLM’s fold after his 1991 breakaway, and worked as Salva’s deputy from 2005 until the summer of 2013. There was no sign the men particularly liked and trusted each other then. That unease will be compounded now, by twenty months of killing.

But trust can be built. “When they fight, Nilotics are tough, but afterwards they can come together as friends” – that, in substance, is what one rebel official, a Nuer, told me on the day of the signing. Riek and Salva may not like each other, but they can work together – as long as both feel this serves their interests.

All the same, it is difficult to imagine Salva or his inner circle permitting Riek to win the nomination to lead the now ruling SPLM for the 2018 elections, or of Riek letting anything stop his ambitions to one day govern the country. These though, are issues for the medium to long term.

One of the real problems with this peace agreement, inevitable though it may have been, is that it resembles a restructuring of the status quo ante. The SPLM house is being put back together again, brick by difficult brick. Yet the SPLM’s record since 2011 has been a disastrous one.

For South Sudan to become a more stable and prosperous nation, issues of bad governance, corruption and the militarisation of the political sphere must be addressed. This agreement will not correct the absence of democracy in the country. (Its creators may argue it could not have been expected to have done so.)

The creation of a hybrid court may go some way to fighting the impunity with which military and political leaders have acted. Following its progress will be one key sign of the viability of the whole deal.

So in many ways, this agreement is fragile, even incomplete. Renewed fighting could break out in the next few days or months, or the whole shaky edifice could tumble down over disagreements in the transitional government. The divergent agendas of the region could intervene once more in South Sudan’s affairs.

Or, quite simply, the agreement could be applied in full, but South Sudan would still have many problems to resolve. And perhaps the domestic and international willingness to push through this next, more difficult, step would have been exhausted.

That, then, is one assessment of this deal. But there is another way of looking at it. In its short life, South Sudan’s leaders have failed it. They have brought destruction rather than development, and chosen chaos and self-interest rather than the difficult path to improving the lives of their countrymen.

This does not have to be a permanent choice. Salva Kiir and Riek Machar, and the many others with the chance to shape their country’s destiny, can decide to change their ways. Redemption in the eyes of history would not be easy, but it is possible. If they are unable to implement this agreement, difficult though it may be, and bring a lasting peace to the country, then it is time for them to leave the political scene forever.

James Copnall is a journalist and author of A Poisonous Thorn in our Hearts: Sudan and South Sudan’s Bitter and Incomplete Divorce. He is editor of “˜Making Sense of the Sudans’.