Winning a war and winning the peace afterwards are two different things. Banal as this may sound, the track record of international efforts at peace building would suggest that even such a banality is worth repeating over and over in the hope that one day success rather than failure becomes the rule, and that the violence and instability that have been (and are) characteristic of Afghanistan and Iraq, Somalia and Kosovo, Cote d’Ivoire and the Democratic Republic of Congo does not remain the hallmark of post-war reconstruction. Yet, even though the balance sheet of internationalised peace and state building is less than stellar it offers important lessons-lessons that become ever more relevant as the conflict in Libya seems to edge towards some sort of negotiated settlement.

Assuming that Gaddafi will exit from a position of relative strength with core elements of his regime still largely intact, one issue is how to handle the transition of power in such a way that real and sustainable change occurs. For a transitional period, this will almost certainly mean continued participation of Gaddafi “loyalists” in governing institutions. They must not be allowed to bloc change, nor must they be deprived of the opportunity to embrace it. The whole-sale dismissal of Saddam Hussein’s army in post-war Iraq serves as a warning of the dire consequences of such a move.

Legitimate and inclusive governing institutions, rightly emphasised as key to stability in the UK government’s recent Building Stability Overseas Strategy, can be achieved through free and fair elections. However, early elections after civil wars are not only likely to deepen divisions and to polarise and radicalise societies, they are often also flawed because they take place before there is anything akin to a functioning civil society, free media, and institutions that make the electoral process work-from electoral commissions to political parties and a judicial system respected and capable of resolving disputes before and after elections. Elections cannot and should not be delayed forever and a day, but scheduled too soon, they are likely to do more harm than good.

Yet the challenges are unlikely to stop there. Gaddafi’s exit from power is likely to trigger some sort of a succession struggle. This will weaken regime camp, but it will equally increase instability and make it more difficult to maintain whatever fractious consensus on a transitional, post-Gaddafi period might emerge over the coming weeks (or months). Equally, the opposition movement, loosely held together in the Libyan Interim National Council will soon come to realise that apart from their desire to get rid of Gaddafi and his regime there is little that unites them in terms of substantive policies. The current anti-Gaddafi consensus is sure to give way quickly to internal struggles for power and positions. While it would be foolish to speculate about how violent potential in-fighting will be among regime loyalists and the opposition, neither bodes well for post-Gaddafi stability in Libya.

Another recurring issue in many post-war situations has to do with transitional justice. Already there are signs, albeit few, of extra-judicial retribution on the rebel side. Revenge attacks are common once the tables have turned, and history is littered with incidents of spontaneous and systematic reprisals-killings, torture, rape, and expulsions are phenomena that are all too common to be ignored. Not only do they cause immediate human suffering but they also contribute to instability further down the line, creating an environment for social and political divisions to consolidate and for hatreds to deepen. A stable political, let alone inclusive democratic process in such situations is difficult at best. Even where proper judicial processes are in place-in country or in international institutions-it is difficult for members and supporters of a former regime not to see them as “victor’s justice”. This is not to say that serious crimes should go unpunished but that a balance needs to be struck between dealing with the past and building a sustainable future. The former Yugoslavia, South Africa, and Rwanda, to name just a few recent examples, have all approached this issue differently, and their successes and failures offer some food for thought.

At the core of these issues lies the question of institution building in the post-Gaddafi era. This will be a complex undertaking, involving reforms of existing institutions and the establishment of new ones, as well as a whole host of staffing decisions. Such institutions will have to be representative of the diversity of Libya. They will derive their legitimacy in part from the degree to which they are representative, but equally from their ability to deliver security, justice, prosperity, and democracy.

Libya will face profound challenges on the day after Gaddafi is gone, challenges that will not be easy or quick to address. But as the signs increase that this day may be nearing, now is the time to think about the post-Gaddafi era and how the knowledge and understanding that has accumulated on how to deal with post-war situations can be put to good use. Even though Libya does not lend itself to an international UN or AU-led model of international administration, this does not mean that the international community has no role to play. Helping Libyans to build institutions and institutional capacity will be the most valuable contribution that the international community can make in assisting that country to avoid the mistakes made elsewhere and build the foundations of a democratic society.