I understand how a man like Anders Behring Breivik fed the flames of his hatred, even if that was not the only reason for his terrible act of terrorism, because I was, for a while, his friend on Facebook.

I joined the Sweden Democrats many years ago. It wasn't because I was a nationalist, or terrified of Muslims. There were two reasons: one was pure and simple curiosity; the other was that I was interested to see how democracy works. I had soon had enough, not because the rest of the world hated me for being a member, but because of all the hate which came my way from people who saw the SD as God's solution to all the world's problems. I had never before come across such hatred.

One day I had a friend request on Facebook from Anders Breivik. There wasn't anything odd about that: when I was a member of SD I was magnetically attractive to everyone who called himself a nationalist: both those for whom it was a game, and the real extremists. Those were, in fact, the people who drove me away from the party. A machine of hate propaganda pumped through my feed on Facebook. There were YouTube clips of massacre victims, demands that all the "fucking niggers" should get out of the country, and far more horrible things.

I reacted by backing away. But for many other people who are weak, or feel bad for some reason, this stream was something to drink from. They egg each other on to believe that the Social Democrats are guilty of all the horrors we'll come to experience; that immigrants rape and murder and that it's the socialists' fault. It is the fault of Mona Sahlin, former Social Democrat leader, that we will be forced to wear burkas and live under sharia law by 2020.

I'm not saying it's wrong to have opinions about immigration, or to protest against the people who really do want Sweden to allow Muslims to have their own courts and laws. I don't think it's right that our borders should be wide open, without any controls – but I utterly reject these reactions. Hatred breeds nothing but hatred.

I don't think that the hot-blooded nationalists who push this line in the name of the Sweden Democrats, on Facebook and elsewhere on the net, have understood the consequences. But Anders Breivik was one of them.

He said very little on Facebook. He was a very quiet man, but that in itself gave me the creeps. I followed him for a while because I wanted to find out if he was what he claimed to be, or maybe "a spy". Please understand that if you're a member of the SD you have to put on your paranoid hat: you learn that there is an enemy hiding round every corner.

There are many people like me – Danes, Swedes, Norwegians, and other Europeans – who had this person as a friend on Facebook. I wonder how they feel now.

Everyone who is critical of aspects of our immigration policies must wake up and realise what their endless talk about dangers and hatred can lead to. Even though no one wanted to fuel this terrible act in Norway, that's what they actually did. And there are more people out there who are looking for reasons to justify their actions by being able to refer to what "others" have written, above all on the net.

There are two things we learned on Friday afternoon. One: extremists are found in all groups, and all are at least as dangerous. Two: hatred breeds hate. Never help to spread it unless you are ready to take the consequences. Did anyone – even you people who hate me for everything else, and belong to the far right – did anyone, even you, really want something this terrible to happen? Surely everyone can see this could never work to anyone's advantage.

On the other hand I am so grateful that all the immigrants and Muslims in Norway and elsewhere in Europe won't have to hide from the wave of hatred which would have swept over them if it had been an Islamist atrocity. Which is not to say it will never happen. Our world has already been shipwrecked already by all this crazy hatred.

Now I will continue to feel sick that I had one of the worst murderers in years on my friend list. I am ashamed of that. I am ashamed.

Translated by Andrew Brown