Emilia Clarke revealed that she has survived two life-threatening aneurysms.

In an essay for The New Yorker, published online on Thursday, Clarke explained that the health scares began just after the success of the first season of Game of Thrones.

"Just when all my childhood dreams seemed to have come true, I nearly lost my mind and then my life. I've never told this story publicly, but now it's time," she began.

The role marked her first major acting credit. While her character, Daenerys Targaryen, has been described as a mix of Napoleon, Joan of Arc and Lawrence of Arabia, Clarke wrote that she "hardly felt like a conquering spirit" when it came time to promote the first season.

"I was terrified. Terrified of the attention, terrified of a business I barely understood, terrified of trying to make good on the faith that the creators of Thrones had put in me. I felt, in every way, exposed," she wrote.

The actress said that prior to Game of Thrones, she considered herself a healthy person. "Sometimes I got a little light-headed, because I often had low blood pressure and a low heart rate. Once in a while, I'd get dizzy and pass out," she wrote. "When I was fourteen, I had a migraine that kept me in bed for a couple of days, and in drama school I'd collapse once in a while. But it all seemed manageable, part of the stress of being an actor and of life in general. Now I think that I might have been experiencing warning signs of what was to come."

Clarke first noticed that something was wrong as she prepared to exercise with a trainer in Feb. 2011. After she "forced" herself through a number of exercises with a bad headache, Clarke said that she needed to take a break.

"I immediately felt as though an elastic band were squeezing my brain. I tried to ignore the pain and push through it, but I just couldn't," she wrote. "Somehow, almost crawling, I made it to the locker room. I reached the toilet, sank to my knees, and proceeded to be violently, voluminously ill. Meanwhile, the pain — shooting, stabbing, constricting pain — was getting worse. At some level, I knew what was happening: my brain was damaged."

"I heard a woman's voice coming from the next stall, asking me if I was OK. No, I wasn't. She came to help me and maneuvered me onto my side, in the recovery position. Then everything became, at once, noisy and blurry," she recalled. "I remember the sound of a siren, an ambulance; I heard new voices, someone saying that my pulse was weak. I was throwing up bile. Someone found my phone and called my parents, who live in Oxfordshire, and they were told to meet me at the emergency room."

After she arrived at the hospital, she was given an MRI. She was diagnosed with a subarachnoid hemorrhage (SAH), "a life-threatening type of stroke, caused by bleeding into the space surrounding the brain." She wrote, "I'd had an aneurysm, an arterial rupture."

Clarke soon learned that approximately a third of SAH patients die immediately after their aneurysms. She had to have brain surgery right away to seal off the aneurysm, though the procedure had many risks. Still, she wrote, that would not be her last or even worst surgery.

Nonetheless, the operation left her in unbearable pain. After she made it two weeks in the ICU without any major complications, a nurse gave her a series of cognitive exercises that tested her on facts, including her name. "Nonsense words tumbled out of my mouth, and I went into a blind panic. I'd never experienced fear like that — a sense of doom closing in," she wrote. "I could see my life ahead, and it wasn't worth living. I am an actor; I need to remember my lines. Now I couldn't recall my name."

She soon learned that she was suffering from aphasia, which is the inability to understand and express speech. And her recovery brought her to some dark places.

"In my worst moments, I wanted to pull the plug. I asked the medical staff to let me die. My job — my entire dream of what my life would be — centered on language, on communication. Without that, I was lost," she wrote.

The aphasia passed after one week, and a month after she was admitted to the hospital, she was released.

While she was able to return to her normal life, she was told that she had a smaller aneurysm that could "pop" at any moment. The doctors said that it could "remain dormant and harmless indefinitely," so they planned to keep a close eye on it.

The recovery process continued as she did press for the first season of the show. "I vividly remember thinking, I can't keep up or think or breathe, much less try to be charming. I sipped on morphine in between interviews," she recalled. "The pain was there, and the fatigue was like the worst exhaustion I'd ever experienced, multiplied by a million."

In 2013, Clarke went to get a brain scan. She learned that the aneurysm had doubled in size and the doctor informed her that she had to undergo a more simple operation, though the surgery was not problem-free.

"When they woke me, I was screaming in pain. The procedure had failed. I had a massive bleed, and the doctors made it plain that my chances of surviving were precarious if they didn't operate again," she wrote. "This time they needed to access my brain in the old-fashioned way — through my skull. And the operation had to happen immediately."

She wrote that the recovery from the second surgery was much more painful than the first. "I looked as though I had been through a war more gruesome than any that Daenerys experienced. I emerged from the operation with a drain coming out of my head. Bits of my skull had been replaced by titanium," she explained.

Clarke spent yet another month in the hospital, where she said she had "lost all hope." "I felt like a shell of myself. So much so that I now have a hard time remembering those dark days in much detail. My mind has blocked them out. But I do remember being convinced that I wasn't going to live," she wrote.

While The National Enquirer published a story about her health issues shortly after the second surgery, Clarke denied that there was anything wrong.

A few weeks after the second surgery, Clarke experienced another excruciating headache while at Comic-Con in San Diego. "I thought, This is it. My time is up. I've cheated death twice and now he's coming to claim me," she wrote.

"In the years since my second surgery I have healed beyond my most unreasonable hopes. I am now at a hundred percent," she wrote in the essay.

Clarke then announced the launch of SameYou, a charity that aims to provide treatment for people recovering from strokes and brain injuries. The organization will look to improve post-surgery and post-hospital care for people who have limited treatment and recovery resources. Additionally, SameYou will provide grants and advocacy support to urge leaders to prioritize and improve neuro recovery care for young adults who have suffered from brain injuries and strokes.

"There is something gratifying, and beyond lucky, about coming to the end of Thrones," she wrote, referencing the final season of the HBO series, which premieres on April 14. "I'm so happy to be here to see the end of this story and the beginning of whatever comes next," she concluded.