'Despite all this, I am lucky: I survived my nervous breakdown, and now have a beautiful daughter who I would never have had otherwise.' Photograph: Linda Nylind for the Guardian

Nine years ago I was newly pregnant when I was violently attacked by my boyfriend at the time. We were having an argument; he hit me in the face causing my ear to bleed, then clamped his hand over my mouth, suffocating me, and told me repeatedly that he would kill me. He said afterwards that the incident only lasted 20 seconds, but those 20 seconds were to change my whole life irrevocably.

It doesn't matter who he was. He could have been anyone. I don't want to identify him, but he was probably different to the man you're imagining: he was more than 10 years older than me, well-spoken, intellectual, ex-private school, cruel, abusive; he was also funny, smart, kind, affectionate, and I was deeply in love with him and thrilled to be carrying his baby. People are complex, and to demonise him and paint him in black and white doesn't make sense – that isn't how real life works.

I managed to get away from him, from that dark room in the middle of the night, but we were on holiday abroad at his relatives' remote house, and I knew they wouldn't help me. I didn't know the emergency number or the address; I hadn't thought I would need to know details like that, because my boyfriend would be taking care of me. I texted home to tell a friend what had happened.

When we returned home the next day I called the police, but because the incident had happened abroad, they said it was outside of their jurisdiction and that I would have to return to that country if I wanted to press charges. Even then it would be his word against mine; in addition, I didn't speak the language in that country fluently, and to return there when I was pregnant and struggling with severe morning sickness, while still being mostly in love with my boyfriend, seemed impossible. I knew there was nothing I could do. The police didn't even take pictures or a written record of my injuries; I went to the doctor to have them recorded.

Though my boyfriend apologised and said "I know I can love you properly, if you only let me", I knew I couldn't stay with him, even though he threatened to kill himself. I left him and had a termination, which I agonised over for weeks because I had been so happy to be pregnant, and had already named the baby. It was very early on so I could take the abortion pill, RU-486, but when I searched for information on abortion online, thousands of pro-life Christian websites came up with enlarged pictures of foetuses sucking their thumbs, and threats that if I had an abortion, I would be sure to die of breast cancer and go to hell. A Catholic friend gave me the number of a Catholic "helpline" where they tried to dissuade me from going through with the abortion. I was so vulnerable after the termination I was scared to fall asleep in case I died and went to hell.

My boyfriend and I had belonged to the same creative community for work; he told everyone in it that I was mentally ill and was making up stories about him. He explained to them that I had had a violent childhood, which was true – a fact I had told him in confidence, and which he used to explain my "illness" (he privately told me that I had subconsciously "wanted" him to violently attack me). He was confident and authoritative and more well-established than me; I was 24, he was 35. Other people in the community believed his story and began to spread it. As I had known it would be, it was his word against mine. Even though I had an email from him confessing to the attack, I didn't want to post a screengrab online; I was too scared of what he might do to me.

The friend who I had texted about the attack said that she was sure I must have done something to provoke it. I started to think it was my fault; I had sworn at my boyfriend during the argument. This friend was my closest friend at the time; she sided with him and I ended our friendship. My next closest friend was my previous ex-boyfriend, who had seen my injuries and was horrified; my boyfriend lied to him that I had cheated on him, causing my ex to sever all contact with me.

I cried for a year. I was constantly fearful of absolutely everything, convinced that strangers would try to attack me. Because of the suffocation, I couldn't be in enclosed spaces without suffering severe panic attacks – and that meant rooms with the door shut and the windows closed, which made professional interviews and meetings difficult. I couldn't take lifts, couldn't take the underground, couldn't take planes. The attack had hemmed in my whole life. I didn't trust anyone, and hated myself for – as I saw it – ending my baby's life.

I had two sets of therapy on the NHS; when it didn't work, I would go on to have five more sets privately: psychodynamic therapy, integrative, cognitive behavioural therapy, cognitive analytic therapy. I was so desperate I even tried hypnotherapy, EMDR and EFT. None of it worked. I was depressed and having suicidal ideations. I woke up sobbing and would go to sleep sobbing.

After that year, I was still very scared, but I was a much harder person. So few people had shown me kindness throughout the experience that I had a very dim view of human nature. I didn't believe in God any more; I was resolutely pro-choice and anti-religion. I had relationships with men, but I didn't let myself fall for anyone, and I didn't believe anyone if they said they loved me.

When I finally started writing for the Guardian in 2008, three years on, my anger and scorn came through in my writing. I wrote a particularly stupid piece about anti-depressants. Reading it now, the subtext says, "If I came through that hellish experience and my whole shitty life without anti-depressants, which don't work anyway, you should be able to cope without them". But I didn't write about the attack; I glossed over my 20s as though they had been uneventful.

Later that year, I started the atheist bus campaign. The campaign was hellish for two reasons: firstly, I had to appear on TV and radio in studios with the doors and windows shut. I had a panic attack nearly every time – one time live on BBC Breakfast in front of six million viewers, though thankfully the segment ended before anyone realised; one time on the Jeremy Vine show, clutching the producer's hand. Any kind of broadcast media opportunities I might have had were curtailed by my claustrophobia.

Secondly, I started to get threats. Not just one or two, but dozens and dozens filling up my inbox. "If you come to America I will shoot you in the head", "I hope you die", "I hope Jesus kills you" etc. I didn't report them because I thought the police would say "What the hell do you expect, running this kind of incendiary campaign?", and besides, none of them were direct enough to warrant police attention – but I received several each day, providing an unpleasantly menacing kind of soundtrack to my life. I thought of taking my email address off my site, but reasoned that I would rather people express their anger in written form than in person, and that I would rather know if people were angry with me. I tried to shrug off the threats by making light of them in public.

I have asked myself a question several times over the past few years: how could I, such a fearful person, have successfully run a nationwide campaign which, though essentially lighthearted, was so potentially inflammatory?

I guess the answer is that I was as angry as I was fearful: angry at the idea that a benign God existed when my whole life had been a testament to the exact opposite; angry at Christian pro-lifers who targeted women at the most vulnerable point of their lives; angry at the Christian bus adverts which linked to a website saying all non-Christians would end up in hell. I never expressed this, though. I had left my ex-boyfriend and that experience behind mentally, even though I was still struggling with it in lots of ways.

I was going up and up. The atheist bus campaign was a huge success and went global, running in 13 countries across the world from America to Germany to New Zealand. Despite the panic attacks, I was still going on TV and radio shows, on BBC1 and Radio 4, was mentioned on Have I Got News For You, and got a book deal with HarperCollins. I managed to get so many people I admired to write for the book, The Atheist's Guide to Christmas – Richard Dawkins, Derren Brown, Charlie Brooker, Simon Le Bon, Ben Goldacre, Simon Singh, Jenny Colgan, Natalie Haynes … it was a bestseller and raised £60,000 for the HIV charity Terrence Higgins Trust. I even overcame my claustrophobia enough to start writing travel pieces for the Sunday Times, and start filming a video series for the Guardian. For the first time since the incident I felt glad to be alive.

And then I fell in love, and I fell apart.

It was the first time I had been in love since the incident in 2005, and something inside me just broke. I was terrified – not that my boyfriend would hurt me physically or leave me – but terrified that someone would kill me, whether the government or a religious organisation or one of the people who had sent me a threat. I didn't deserve this amount of beauty in my life. I decided I would try and kill myself before "they" killed me, but I was too scared to commit suicide, so I just lay in bed and shook and screamed. I screamed for my boyfriend to help me, but he couldn't – nobody could. I withdrew from everything – I cancelled the Guardian video series and stopped pitching pieces to all my editors. I took my name off the US and paperback editions of the book I had edited, the book I was so proud of. I begged my boyfriend to leave me because I couldn't bear to see him fall out of love with me due to my illness. To his credit, he didn't; he waited for me to get better. I didn't get better.

I was put on antipsychotic medication, but was too scared to talk to anyone about my thoughts in case "they", the establishment I had upset with the campaign, were following and monitoring and recording me. I fell pregnant, started eating compulsively and put on five stone in weight. Despite the medication the thoughts worsened, and I started researching ways to kill myself. I obsessively visited suicide and euthanasia websites, trying and failing to find someone who would help me commit suicide while pregnant.

When I gave birth to my daughter, more than a year after my nervous breakdown began, I was temporarily elated and felt well enough to re-emerge on Twitter. I felt so well I came off my antipsychotic medication and quickly became suicidal again. Because I was a new mother with mental illness I was assigned a psychiatrist quickly, and I will forever be grateful that he put me on an additional drug, an anticonvulsant, and diagnosed me with generalised anxiety disorder with prominent paranoia. The drug got me back to feeling 60% normal, and the thoughts slowed down. It would take another drug to treat my other condition, obsessive-compulsive disorder, to get me back to where I am now: 80% normal and fully functioning. I will probably have to take all three drugs daily for the rest of my life. I am hugely grateful to medical science and the amazing doctors in the NHS for giving me my life back.

It is one of my greatest regrets that romantic relationships cause me to panic to the extent that life becomes unbearable. I have no doubt that it is related to the incident in 2005, but I have forgiven my ex-boyfriend for what happened. I keep trying to get into relationships, needing someone to spend my life with, then withdrawing when the horrific anxiety sets in again. Despite all this, I am lucky: I survived my nervous breakdown, and now have a beautiful daughter who I would never have had otherwise. I also have two great friends, Graham and Emily, whose kindness I will never forget.

I didn't expect to be telling this story now, but I turned 34 last Thursday and it got me thinking. For many years, I have hidden the extent of my mental illness: because of the stigma, because I didn't want people to think I was weak, because I didn't want anyone to take my daughter away, and because I was scared that – if I ever died in an accident – people would wrongly assume it was a suicide because of my mental health issues. For the record, I love my daughter more than life itself, and would never ever leave her. I have missed far too much of my life due to fear, and I want to embrace every second of it.

During the years that I struggled desperately, I couldn't believe that I would ever feel well again or overcome the crippling anxiety that destroyed any chance of happiness. Everyone I read about seemed to be coping with life effortlessly; I was the only person who couldn't cope. I wanted to tell this story to let anyone who had a violent childhood know that there can be life afterwards, to let anyone who has experienced domestic violence – during pregnancy or otherwise – know that life can get better, to let anyone having a breakdown know that there is hope, and that though the future often seems insurmountably bleak, time and the right medication can make life worth living again.

I wish there were a more cohesive narrative to this story, and that it were less of a muddle, but life is rarely neat. We are all messy and just muddling through the best way we know how. Lots of people have told me never to tell this story, and for years I refused to tell it, but I am no longer ashamed. What is shameful is not being a victim of violence, or having a termination as a result, or receiving threats, or falling apart, but instead being a complicit part of a society that says that victims should remain silent and hide the crimes of others, as well as their own frailties. It is not a society I want my daughter to grow up in, and if I want to change the way it works, speaking out myself is the first step.