Muammar Gaddafi remains notionally in power in Libya today. But his lunatic reign, which has made the lives of millions of Libyans a nightmare for decades, now only extends to a few blocks of Tripoli and those few towns in the rest of Libya where the last remaining loyalist forces hold out. The final collapse of his régime, when for so long it appeared he had discovered yet another way to cling to power despite a massive uprising in his own country, has proved surprisingly swift.

Moreover, it is fitting that his end comes on the back of an uprising in Tripoli itself. It was in Tripoli, in February, that the worst atrocities of his régime occurred, when mercenaries were brought in to use heavy-calibre weapons on protestors in an attempt to cow Libyans back in to the silence from which they were breaking free as the Arab Spring erupted across the Middle East.

Once Gaddafi and the last holdouts are tracked down, the transition to a new government will begin, and it will be difficult. Libya’s long history doesn’t lend itself to confidence that good will and solidarity among the National Transitional Council forces will persist once the shooting ends. Nonetheless there are some positive signs. The NTC has been at pains to prevent reprisals against the Gaddafi family, and has two of Gaddafi’s sons, including the vile Saif al-Islam, in custody. Transitional government and constitutional arrangements have been in preparation. Most importantly, there is no foreign military force in the country. It will be up to Libyans themselves to settle their own future.

Crucial to that will be justice for those responsible for the régime’s atrocities. The International Criminal Court has issued warrants for Gaddafi himself, Saif and another key senior official. But their first responsibility must be to the people over whom they so mercilessly exercised power for so long. A safe, orderly and fair trial for Gaddafi and his cronies is a key step for a new Libyan state.