I went to an all boys' boarding school - Orley Farm in north London - in 1963, when I was eight years old. It was a vile and destructive experience.
The only adult friend to me there was Harry Thompson. My memory of him is a little vague. I haven't seen him for 40 years because that is when he died - shortly after I left. But I do remember he was the one who helped me scrape into my secondary school, Rugby.
Harry taught English, so he was already on my side. I remember him as a plump, old-fashioned man. He wore a suit, and I seem to recall it was a three-piece. He used fruity language, had various chins and had a certain bonhomie - a bit like an Evelyn Waugh character. He was not exactly a shining light, but he was more humane and kind to me than anyone else at that school. My experience there was horrendous.
Twenty years ago, I went back to Orley Farm to give a talk. It has been rebuilt and modernised, but one section was the same: the dining room, the locker-lined corridor and the headmaster's study, where I was beaten many times.
The moment I walked down that corridor, I froze. I started sweating, my palms went cold and I thought I would pass out. I had to have a moment to catch my breath. It all came flooding back: the hair-pulling, the neck-grabbing, the beatings, the bullying, the blackmail, the physical abuse.
I was far from being a perfect child, but what is the point of school if all it does is tell you how useless you are, how you're never going to amount to anything?
I was made to feel fat, ugly and unintelligent, but I was writing plays by the age of 10. Any quarter-decent school would have picked up on that and encouraged me, but I was ridiculed and sneered at.
I was not meaningfully naughty but trouble found me. One time, the head made me stand in front of the school. He said Christmas had been cancelled for me because of my bad behaviour. Everyone else had a party.
My parents realised that I had no chance of passing my common entrance exam, so I was sent to Harry during the holidays for extra tuition. I remember going to his house in Harrow-on-the-Hill twice a week and it was pleasant. He did help me. He taught me every subject, plus the different parts of a ship, for some reason. He drank and smoked heavily. His fingers were nicotine-stained. Harry struck me as being an unhappy person.
With patience and something of a smile, I got through my common entrance and into Rugby. I was bullied for the first year, but thankfully things got better for me.
But the effect of Orley Farm is still with me today. I have no doubt it would have destroyed me if it wasn't for my wife and books. I got through it by telling stories in the dorm - about escape and running away.
I didn't need to tell my parents how awful it was: three days before the end of every holiday, I would have nightmares and become hysterical. Until my dying day, I won't understand why they didn't pull me out. It was clear I was unhappy, but I think they thought it was character building.
The ghosts are still there. I'll never go back to that school again. I often wonder whether I would swap my adult success for happier school days. I think the answer would have to be yes.
Anthony Horowitz's novels include the Alex Rider and Diamond Brothers series. He also created the ITV series 'Foyle's War' and his latest book, 'More Bloody Horowitz', is published on Monday. He was talking to Hannah Frankel.