Nato intervened in Libya under a UN Security Council mandate to protect civilians. The intervention has been successful so far, but controversial, in that there have been concerns about Nato exceeding the mandate. The future of the Libyan revolution will influence not just the future of the Libyan people, but the ability of future international action to forestall looming atrocities.
The UN mandate came about partly because at its 50th anniversary summit 150 heads of state and government declared that, if states did not protect their people from atrocities, the wider international community should act to do so, if necessary using military power. This is the essence of the Responsibility to Protect.
One of its founders, Gareth Evans, a former foreign minister of Australia, said at Chatham House this month that this doctrine is now embedded in international discourse and increasingly in international practice.
Evans stressed the five criteria that should be used to determine whether the use of force would be legitimate: that the threat faced is a serious one; that force would be used to avert this threat (the primary purpose test) and not to further the ulterior motives of the interveners; that it would be used as a last resort; that it would be proportional; and that the consequences would be balanced in favour those being assisted.
Cameron and Sarkozy drew on these vital principles in their early statements about the limits of foreign intervention, stressing legality, regional support and achievability. There is little danger of their being carried away in proposing other interventions that might look necessary but would not actually meet the criteria. And if they threw caution away, the international community would not do so – the case of Syria shows that.
Not that Britain or France, or indeed Nato as a whole, has the military or financial muscle for large foreign adventures. The UK National Security Council has more than proved its worth over Libya. It is likely to continue to stress that a purely national test of our interest should be met before intervening.
Libya, therefore, is not a direct precedent for involvement in the Arab world. The situation in March presented a rare alignment of three factors: a convincing popular request from the victims of the Libyan government, which had few allies (other than Gaddafi's clients in Africa); regional support for intervention from the Arab League, with international legality established through the UN Security Council; and a modest military task coupled with a convincing exit strategy.
David Cameron's line after Gaddafi's death was right: no crowing; no lectures about the way ahead that Libyans have already mapped out; an understanding that this has been a Libyan achievement but taking justifiable satisfaction from the part played by foreigners; acknowledging Gaddafi's victims in Libya and elsewhere, including the UK; and a readiness to go on supporting the transition.
Arguments will continue for some time about whether Nato stuck to the criterion of proportionality as the Libyan campaign evolved, but there is no doubt that, with that possible exception, Nato, with the UK and France leading, got it right. Above all, Libyans now have the freedom to make the best of their future.
That this future is uncertain does not call into question whether we were right to do what we did, but uncertain it is. I am optimistic. Libya's national spirit, its habit of consultation and co-operation, and its wealth, together with limited and targeted international assistance, will in time prevail over the dangers presented by the absence of a framework for civilian control of the military, possible factionalism and uncertainty over policy on day-to-day issues.
Neither the social identity granted by belonging to a tribe, nor the tiny minority steeped in ideas of righteous violence to reorder the world should be seen as game-changers. Oil wealth will be a binding force, rather than a reason for quarrelling. The idea that no one except evil-minded people would benefit from chaos will be powerful, as will a Libyan habit of co-operation with government. The reasons for Libya to hold together and to avoid a vacuum of power in which warlords could take hold are strong.
These are all serious challenges, but ones that I believe have been allowed for in the planning that Libyans have made for transition. Turning theory into practice will be hard, and there will be setbacks. But the possibility that successes will lead to more achievements is stronger than the possibility that failure will follow failure in a downward spiral.
The manner of Gaddafi's death presents the new Libyan government with its first international challenge: how to reconcile foreign calls for an inquiry with the feeling in Libya that an evil man, who had embroiled the people in war and who refused to surrender when all was clearly lost, got what he deserved.
The international community should make clear that extrajudicial execution and killing a prisoner are wrong wherever they occur. But it would be unwise to dwell too long on the point, in the context of the chaotic end of bloody fighting in Sirte. To do so would also prompt calls for other notorious killings, perpetrated by countries who are our allies, or who claim to share high ideals, to be scrutinised and criticised – as indeed they would be in a fairer world.
Whether a trial would have been better for the world is now a hypothetical question. Gaddafi's death robbed his victims' families, Libyan and British among them, of the chance to see him questioned on how and why things were done as they were. The sight of Gaddafi in the International Criminal Court would have been a powerful signal to bad rulers elsewhere. But drawing a line under the past so decisively may turn out to be more of a help than a hindrance to Libya's progress now.
Gareth Evans ended his talk earlier this month with a plea that the criteria for exercising the Responsibility to Protect should be applied carefully to future cases. That would be the best way, he argued, of taking the heat out of high-level debates about whether the outcome of particular operations would argue for intervention or non-intervention in future instances.
For now, we can be sure that a serious risk was averted in Libya, that intervention has not boosted the interests of foreigners at the expense of Libyans, and that the consequences have been positive. Libyans have got the opportunity they craved.
Sir Richard Dalton is a former British ambassador to Libya