A little more than two years after Academy Award winner Robin Williams died, his wife penned a highly personal essay recounting the painful and often confusing struggle leading up to the actor's 2014 death.

The essay, titled "The terrorist inside my husband's brain," was published Tuesday by a neurology journal. Susan Schneider Williams wrote at length about her loss, and the months when her husband's mind deteriorated because of a disease he didn't know he had - a disease that later drove the 63-year-old actor to commit suicide.

"Robin was losing his mind and he was aware of it. Can you imagine the pain he felt as he experienced himself disintegrating?" Williams wrote. "And not from something he would ever know the name of, or understand? Neither he, nor anyone could stop it - no amount of intelligence or love could hold it back."

Robin Williams had what is called Lewy body dementia, or LBD, a little-known brain disease that affects more than a million Americans. It damages brain cells over time, leading to memory loss, delusions, hallucinations, Parkinson's symptoms and other health problems. In the actor's case, it wasn't until after his death that his family found out he had the disease.

The "firestorm of symptoms," Susan Williams wrote, began in October 2013, the month of their second wedding anniversary.

"His fear and anxiety skyrocketed to a point that was alarming," Williams wrote. "I wondered privately, 'Is my husband a hypochondriac?'"

Over the next 10 months, Robin Williams struggled with paranoia, delusions, insomnia, to name a few afflictions. A panic attack followed in April 2014, when he was in Vancouver filming "Night at the Museum: Secret of the Tomb."

The brilliant actor who trained at the Juilliard School struggled to remember even one line, his wife wrote.

"This loss of memory and inability to control his anxiety was devastating to him," Susan Williams wrote. "I will never know the true depth of his suffering, nor just how hard he was fighting. But from where I stood, I saw the bravest man in the world playing the hardest role of his life."

Several tests, including blood and urine tests, and a brain scan, all came back negative. Still, they knew something was terribly wrong, Susan Williams wrote.

"I just want to reboot my brain," she recalled her husband saying.

In May 2014, Robin Williams was diagnosed with Parkinson's disease.

Later, more symptoms.

"At times, he would find himself stuck in a frozen stance, unable to move, and frustrated when he came out of it," Susan Williams wrote. "He was beginning to have trouble with visual and spatial abilities in the way of judging distance and depth. His loss of basic reasoning just added to his growing confusion."

Throughout his illness, Robin Williams had struggled with more than 40 symptoms of LBD.

By the second weekend of August 2014, Robin Williams's delusions seemed to be calming down. By the end of the day on Sunday, Aug. 10, 2014, it seemed as if he was getting better, his wife wrote.

"When we retired to sleep, in our customary way, my husband said to me, 'Goodnight, my love,' and waited for my familiar reply, 'Goodnight, my love,'" Susan Williams wrote.

Robin Williams died the next day.

His assistant found him in his bedroom in his home in Tiburon, California. He had hanged himself with a belt.

"After Robin left, time has never functioned the same for me," Susan Williams wrote. "My search for meaning has replicated like an inescapable spring throughout nearly every aspect of my world, including the most mundane."

Susan Williams said she'd spoken with medical professionals who reviewed her husband's medical records.

"Their reactions were all the same: that Robin's was one of the worst LBD pathologies they had seen and that there was nothing else anyone could have done," she wrote.

Robin Williams was known for his improvisational style as a stand-up comedian and for performances in movies like "Dead Poets Society" and "Good Will Hunting," a film that earned him an Academy Award for best supporting actor.