The enormous cost of Islamic State's demise in Raqqa

For three years, Raqqa was capital of the biggest, richest, and arguably most evil terrorist organisation the world has known.

At its height, as many as eight million people lived on land that Islamic State controlled in Iraq and Syria.

When the organisation took the Iraqi city of Mosul, it looted its banks.

Added to other revenues acquired through oil smuggling and taxation, IS had resources that other terror groups could only dream of.

:: Raqqa: Battle 'over' in Islamic State's Syrian capital

But for a while, at least, it also had a unique selling point: as long as it was expanding its territory, it was able to claim it was rebuilding the Islamic Caliphate.

Thousands of people heard its siren call and travelled from ordinary homes across Europe and beyond to swell its ranks.

Among them were throat-slitting psychopaths, rapists and child abusers, aware they would be able to indulge those behaviours with impunity - executing prisoners and filming their actions for cynical propaganda purposes, and enslaving and repeatedly raping women and young girls.

:: The rise and fall of Islamic State in Raqqa

Raqqa was the administrative heart of Islamic State, where its brutal repression of millions in Iraq and Syria was controlled. It was also from where it planned, inspired and launched murderous terror attacks far beyond Syria's borders.

Anyone appalled by its grotesque reign of murderous terror can celebrate its demise in the city that was for so long its base.

But the cost has been enormous. As many as 1,000 civilians are thought to have been killed in the allied air bombardment that supported the assault against IS on the ground.

Most of the city is now rubble, pulverised by airstrikes and artillery.

More than 250,000 people were forced to flee as the fighting around Raqqa intensified.

And the battle against IS is far from over.

Hundreds of fighters have escaped Raqqa and fled east - it's thought to land still controlled by IS, in particular Deir al Zor towards the Iraqi border.

Many others may have travelled further afield, back to their home countries.

As IS loses the battle to control territory in both Iraq and Syria, it will adapt and metastasise, mutating so it is able to present new threats in the countries its fighters came from and in its Middle Eastern heartlands.

One crucial battle is over; the war will go on.