In 2009, Susannah Cahalan was 24 years old and living the kind of New York life that young women who have watched too much Sex and the City dream about. She had the go-getting job as a news reporter on the city's tabloid New York Post. She had the musician boyfriend, the gadabout social life, even the cubbyhole apartment in a desirable part of town.

And then she had hallucinations, seizures, personality disorder, psychosis and, finally, catatonia. Not so Carrie Bradshaw, then. "My tongue twisted when I spoke; I drooled and, when I was tired, let my tongue hang out of the side of my mouth like an overheated dog."

For a month, she was a medical mystery. The first neurologist she saw told her there was nothing wrong with her. A psychiatrist said it was bipolar disorder and prescribed medication. A second neurologist suggested it was "alcohol withdrawal syndrome" and prescribed different medication. None of the diagnoses fitted. And, when, eventually, she was admitted to NYU hospital, nobody there knew either. For a period of time, she was, according to the description of one friend, like something from "a zombie movie".

You wouldn't know any of this meeting Cahalan today. She's back in zingy red lipstick, drinking coffee in a hipster cafe, pondering the strokes of luck – the bad luck and the good luck – that have brought her here.

How was she? people continually asked when she was recovering. "I didn't even know who 'I' was any more." That uncertainty about herself, and who, under the effects of her illness, she became, is at the heart of Brain on Fire, her account of her illness, a survivor's memoir with a difference: a narrator so unreliable she can't even remember whole scenes that happened to her.

For a while, she disappeared; the Susannah Cahalan who was admitted to NYU hospital's epilepsy ward and who, when she watched TV, believed people were talking about her on the news, was not the Susannah Cahalan she'd always known and who she is now. Researching the book involved forensically investigating herself.

"I had to bring the idea of journalistic distance to writing about myself. Because I'd been a reporter, I had these tools, but it was an extremely dissociative process.

"The first thing I did was to get the facts. So I got my medical records, and I put together a timeline of events – the day I had my brain tap, the day I had my biopsy, and so on. And then I interviewed people about myself. So I have these things that are objective facts, but there are still significant blanks."

It is, at times, a terrifying read, not least because for much of the time she was herself terrified. "What I remember most vividly," she says, "is the fear. Fear and anger." She carried on as normal at first, even when the neon signs of Times Square brought on a blinding migraine and the walls of her office "were breathing visibly, inhaling and exhaling all around me". Finally, a blood-and-foaming-at-the-mouth seizure, on the sofa at her boyfriend's flat, led her to see a neurologist. But he couldn't find anything wrong. All the tests came back fine. He sent her to see a psychiatrist instead.

What the psychiatrist saw was a psychiatric disorder. She was diagnosed with a mixed episode containing both manic and depressive behaviour and prescribed with an anti-psychotic. It was only because her family didn't believe it that she ended up seeing a second neurologist – "one of the best in the city" – who told her she just needed to "lay off the partying". Pressed by her family, he reluctantly agreed to refer her to the epilepsy ward at NYU hospital.

What comes across strongly in Cahalan's account is how privileged she was. She had access to some of the best doctors on earth. "I was at one of the best hospitals in one of the best cities in the world," she says. "And they still didn't know what was wrong with me." (She grew up with her mother and stepfather in Summit, New Jersey, "an affluent Wasp suburb". By her side was her banker father, who lives in a "magnificent Brooklyn brownstone".)

Treatments were ordered that cost $20,000 a time (the hospital bill for her care topped $1m) and yet "it was all just so haphazardly done. All these people said, 'Well, maybe it's this. And here's some medication.' And then somebody else would say, 'Well, maybe it's this.' And give me other medication. Nobody seemed to know anything. And these are not just Joe Schmoe doctors; they are top, top doctors."

What Cahalan learned, the hard way, was that there's so much that is completely unknown about the brain. "We are only in the beginning stages of understanding how the brain and body work together, and there's so much left to figure out. We are still in the dark ages in terms of our understanding of the brain and of psychiatric illnesses. Cases like mine are like the first beam of light that we are seeing."

Because it turned out that she didn't have bipolar disorder. There is a Hollywood moment at the centre of her story when, after seeing dozens of specialists, each as clueless as the last, a new doctor entered the scene: Dr Souhel Najjar. By this stage, Cahalan had turned, by her own description, into "some sort of animal. I was grunting. And making abnormal movements. I was kicking and punching people." Her family were desperate, but they clung to hope.

"She's still in there," her boyfriend, Stephen, said at one point. "I can see her. She's still there. I know it." In the end, it was a clock-face test, a standard psychiatric tool, that suggested that there was a physical cause to her mental condition. Najjar got her to draw a clock face and she drew exactly half a clock face, "concrete evidence that the right-hand side of my brain was inflamed".

Najjar "sat down on the bed near me. He turned to my parents and said, 'Her brain is on fire… I'm going to do everything I can for you.'" Maybe the scene has been embellished in the retelling, but, for Cahalan, it was her knight-in-shining-armour moment, with Najjar appearing as a cross between Hugh Laurie in House and Richard Gere in the last scene of An Officer and a Gentleman. "For a moment, I seemed to come alive, he would later recall to me. I'll always regret that I remember nothing of this pivotal scene, one of the most important moments of my life."

Najjar was right. A biopsy confirmed his hunch, and shortly after, Cahalan and her family discovered her condition has a name – anti-NMDA receptor autoimmune encephalitis. It's a brain inflammation, caused by an unknown agent or infection, that had first been described just two years previously, and Cahalan was only the 217th person to have been diagnosed with it.

The terrifying thing after the event is how close she came to not getting the diagnosis. They caught it at the catatonic stage that "precedes breathing failure, coma and sometimes death". She was lucky. The brain biopsy enabled the right treatment to be found and gradually she started to recover. But without it, who knows? "It's hard to say. There's never been a natural history of the disease because it was only discovered in 2007, but I think it's safe to say that I would probably have ended up in a psychiatric ward. They were leaning toward that anyway. Or, a nursing home. Or, I could have died.

"Even with treatment, about 7% of people still die. Others are severely cognitively impaired. I suspect that there are people who have lived in institutions their whole lives who had it and were never diagnosed."

Her bad luck was developing the condition. Her good luck was seeing someone who had read the literature and recognised it. But the ramifications of her case, she believes, go much further.

"If an autoimmune disease can create symptoms that look exactly like schizophrenia, that raises the question, what is schizophrenia? And are there forms of schizophrenia that are caused by other types of autoimmune disease? Or other diseases that we haven't discovered yet? It's all neurological. We separate problems with the brain into neurological and psychiatric, and it's because it's stigmatised still. Mental illness is still stigmatised.

"Imagine if we treated people with cancer like that. Just because your personality changes and your behaviour changes, all of a sudden you are put in a different category."

Najjar, associate professor of neurology at NYU medical centre, estimates that 90% of people suffering from the disease in 2009 went undiagnosed. Hardly anyone, after all, has access to $1m worth of medical investigation, though it is beginning to be more recognised now, with the number of people diagnosed "in the thousands". In Najjar's opinion, some forms of schizophrenia, bipolar disorder, OCD and depression are actually inflammatory conditions of the brain. And he is now looking at the brains of schizophrenia sufferers from postmortems to see if he can establish evidence of physical disease.

It's a contentious claim, as yet unproved, but with potentially revolutionary results, affecting millions of people worldwide. But then, as so little is actually known about the brain – "a black box" as Cahalan describes it – it's also possible that mental illness isn't so mental after all; that it's just illness.

Cahalan has made a full recovery. She's not one of the 15% who recover but suffer severe cognitive deficits, or even the 20% who suffer mild ones. And, after writing about her experience in the New York Post, she's been inundated with emails and messages from people who think that they, or somebody they know, has, or had, the disease. Or who have other psychiatric conditions that they now believe may be curable. There have been appearances on talk shows and now there's the book.

"I want to get the word out there, and, because of the article I wrote and going on talk shows, I have got the word out there. People have been diagnosed because of what I wrote. But, at the same time, you don't want to give people false hope. That's something that I am aware of but I don't yet know how to reconcile."

She is haunted by what might have happened if she hadn't been diagnosed. The condition affects mainly young people and it looks like "evil". To the untrained eye, she writes, it appears "malevolent. Afflicted sons and daughters suddenly become possessed, demonic-like creatures." Her boyfriend, she says, "can no longer watch The Exorcist". It's too close for comfort.

Writing her story was about "regaining control. Something happened to me that was out of my control, that was something other than me, that took over my life, and robbed me of a good portion of my 24- and 25-year-old self."

The experience has, of course, changed her, though she's not exactly sure how. "When I look at photographs of me 'post-' versus pictures of me 'pre-' there is something altered, something lost – or gained, I can't tell – when I look into my eyes."

She's not spending the rest of her life in an institution, though. Or brain-damaged. Or dead. She's one of "the lucky ones" – who has been over to the dark side of the brain and survived.

"Some people say how they'd like to live in different eras. Not me. I'm so grateful to be alive right now. Had I had this any time before 2007 or been born at any other time, I probably wouldn't be here talking to you now."

Susannah Cahalan will be giving a talk at Foyles bookshop, London WC2, supported by the Encephalitis Society, on Weds 6 Feb.