We got rid of Muammar Gaddafi. I never thought I would be able to write these words. I thought it might have to be something like: "Gaddafi has died of old age"; a terrible sentence, not only because of what it means but also the sort of bleak and passive future it promises. Now rebel forces have reached Tripoli, we can say we have snatched freedom with our own hands, paid for it with blood. No one now will be more eager to guard it than us.

This is a tremendously important victory for Libyans and for any nation wanting to control its future. Gaddafi tried to give a masterclass to men like the Syrian dictator, Bashar al-Assad, on how to crush a civilian uprising. Assad's violent crimes in recent days show not only the stupidity of that regime but also how it was darkly inspired by the Libyan example. Just as the people of the Arab world have gained strength and confidence from one another's victories, Arabic dictatorships too have been looking to each other.

Libya is critical because it is where the Tunisian and Egyptian domino effect might have stopped. The Syrian people are now stronger, and although I hope they will not need to sacrifice what we have had to sacrifice, I know that their hearts are bolder today than they were yesterday. There are moments in history when brotherhood between people no longer seems an abstract idea. Libya's revolution has undermined every totalitarian rule and every oppressive individual. It has inspired that most profound ingredient in any uprising - a nation's ability to imagine a better reality.

Yes, we got rid of Gaddafi. We have confirmed ourselves as a nation that calls for the light, a people willing to die for the light. For exactly 100 years now, our country has battled fascism. In 1911 we had Mussolini, then, after a short break under King Idris, in 1969 we had our own home-grown variety of authoritarian rule in the form of Gaddafi, who called himself al-Qaid – the Arabic equivalent of Il Duce, or "the leader". Both were violent, deceitful and dishonourable. Both stole our property and raped our women. Both killed and disappeared our people. Both, in their own way, were absurd. Being Libyan has sometimes felt like that poor wretched man beaten by a clownish buffoon in public.

The past six months have put an end not only not only to Gaddafi's rule but also to the myths propagated by its extensive PR campaign, managed by companies in London and New York and promoted by western governments and companies wishing to do business with the dictator. Seeing respectable nations treat Gaddafi's thugs with respect was a continuous source of anger, pain and isolation for many Libyans.

Now the true nature of the Gaddafi regime has become explicit in the most gruesome and macabre way. The killing and pillaging of the past few months has disquieted even those Libyans most familiar with the dictatorship's tactics and past crimes.

Libyans have displayed astonishing resilience and courage. Our revolution is a compelling response to tyranny. For nearly half a century now, our national experience has been marked mainly by shame, pain and fear. Now pride, confidence and hope are our allies. Today, more than any other day, we must remember those who have died since 17 February, and the many who died before that.

We must hold dear in our thoughts and hearts the students hanged in the 1970s; the dissidents paraded on television then assassinated in sport stadiums in the 1980s; those disappeared in the 1990s; the internet dissidents of the early 2000s; and the beautiful young lions who faced the tanks in their jeans. We must hold sacred our dead, our city squares, and our women who were violated.

We are of course confronted with the most profound challenge: how to build a democracy in a country whose institutions and civil society have been strangled for 42 years. There will be setbacks, we will make mistakes, but there is no other way to learn. We have defeated Gaddafi on the battlefield, now we must defeat him in our imagination. We must not allow his legacy to corrupt our dream. Let's keep focused on the true prize: unity, democracy and the rule of law. Let's not seek revenge; that would diminish our future.

One of the rebels fighting in Zawiya said: "After years of not knowing what to do, now we know precisely what we must do." Purpose is sweet, victory sweeter. We have got rid of Muammar Gaddafi. Now the building starts. Let's learn from the achievements of our Tunisian and Egyptian neighbours and, like them, seek to subject our old rulers to fair and robust trials - ones motivated by accountability and not retribution.

Hisham Matar is the author of Anatomy of a Disappearance, a novel published by Penguin

Fierce clashes are reported between rebels and Gaddafi forces in the Abu Salim district in Tripoli, just south of Gaddafi's former compound. There is speculation that Gaddafi – or one or more of his sons – may be holding out in the district