Ten years after Nato jets went into action against Serbia, the Kosovo war remains as controversial as ever. Welcomed by many at the time as evidence of a humanitarian world order in the making, its legacy has been overtaken, subsumed and ultimately distorted by the debate about the war on terror. What Vaclav Havel called "the first war for values" is now more often described as a dangerous precedent. Even Clare Short, a forceful advocate of intervention in the Balkans, attributed Tony Blair's foreign policy errors to the "taste for grandstanding" he acquired in Kosovo.

There are several reasons for this, the most important undoubtedly the effect of the Iraq war in sowing doubt about the legitimacy and efficacy of western military power. In departing from the principle of non-intervention and lacking a UN mandate, Kosovo is often regarded as the original sin that made Iraq possible. Even Russia's invasion and recognition of Abkhazia and South Ossetia have been characterised as blowback from Kosovo's declaration of independence a few months before.

Comparisons of this kind confuse more than they clarify. The war in Kosovo was a response to a humanitarian emergency, not a geopolitical power play. Even so, this point is still contested. Self-styled anti-imperialists, all too often apologists for the imperialism of any regime that opposes the west, have constructed an alternative history in which Slobodan Milosevic's crimes are minimised or excused and a rapacious west portrayed as the instigator of violence. In this history, his efforts to reach a negotiated solution were sabotaged at the Rambouillet peace conference by Europe and the US; and the deaths and refugee movements inside Kosovo were caused by Nato bombing.

These critics talk as if the destruction of Bosnia was a figment of the imagination. The reality is that by the time of Rambouillet, western leaders had wised up to Milosevic's game of rope-a-dope in which he negotiated peace in bad faith while continuing to unleash ethnic terror on the ground. They had already endured eight years of it. In Kosovo, Serbian forces had killed 1,500 and driven 270,000 from their homes before Nato acted. The violence accelerated immediately before and after the start of the bombing campaign, but opponents deliberately invert cause and effect.

A survey by eminent statisticians in 2002 confirmed what refugees had always maintained - they were fleeing an organised programme of ethnic slaughter. An analysis of available data revealed a strong correlation between deaths and displacements, and Serbian military activity. There was no correlation with Nato or Kosovo Liberation Army actions. And the speed and extent of Serbia's mobilisation was indicative of a preconceived plan, not a spontaneous reaction to Nato bombing.

About 850,000 people - half Kosovo's Albanian population - were driven out of the country, many with their papers seized to prevent them returning. About 10,000 were murdered by Serbian forces. These atrocities may not have passed the legal test of genocide, but the reality was awful enough. The Serbian state carried out a crime against humanity - a ruthlessly executed plan to change the ethnic composition of Kosovo through expulsion and mass murder.

Had Milosevic completed his ethnic cleansing, the Balkans would be a very different place. A nationalist successor regime in Belgrade would be dedicated to preserving his victorious legacy and destabilising the region with unfulfilled dreams of a Greater Serbia. Hundreds of thousands of Kosovan Albanians would still be in refugee camps in Albania and Macedonia. The expulsion of the Kosovans would have joined al-Qaida's rap sheet of "Crusader" crimes against Muslims, an accusation doubtless echoed by the same critics who condemn Nato for preventing it. Let's not forget that Milosevic waged his war in the name of Orthodox Christian supremacy, or that Ariel Sharon, obsessed with the "Islamic threat" of a Greater Albania, was among his most vocal cheerleaders.

Kosovo also differed radically from the Iraq war in its intended effect on the international system. In the case of Kosovo, it was Russia that acted unilaterally in refusing to accept the balance of international opinion. Every member of Nato and every EU country, and all Serbia's neighbours, supported military action. Operations were conducted through the multilateral structures of Nato, with post-conflict authority handed to the UN. The governments carrying out this intervention knew it was a radical departure, but didn't do it to undermine multilateralism or strengthen US dominance. They wanted the international community to accept that the UN's commitment to individual human rights should count for more than the sovereign rights of states and their rulers. They wanted to enforce international legal norms, not undermine them.

Aspects of Nato's conduct can be criticised. The use of cluster munitions, careless and illegitimate targeting, and high-altitude bombing all resulted in unnecessary loss of life. The failure of Nato troops to prevent revenge attacks on Serbian and Roma civilians dishonoured their humanitarian purpose. But it is bogus to compare such serious errors to state-sponsored ethnic cleansing.

A decade on, many problems remain. Reconciliation between ethnic communities has not been achieved; Serbian enclaves are unwilling to co-operate with the Pristina government; and Serbia still refuses to face up to the loss of sovereignty over Kosovo. Yet independence has not led to the predicted upsurge of ethnic violence and extremism. The region's countries are moving steadily, if awkwardly, towards a new kind of unity as EU members. This includes Serbia, whose democratic government has already handed over Radovan Karadzic to The Hague and is committed to meeting its international obligations. Ultra-nationalists are marginalised, and the region has the opportunity of a future free of violence and despair.

The war in Kosovo was ultimately a question of whether the fall of the Berlin Wall would mark a return to the ethnic barbarism and power politics of the pre-cold war era, or a better phase in European history. That legacy has not been honoured as it should have been. Nevertheless, Kosovo should be remembered as an example of western nations using their power, however imperfectly, to do something good and necessary.

• David Clark served as Europe adviser at the Foreign Office, 1997-2001 dkclark@aol.com