Emilia Clarke revealed Thursday that she underwent two life-saving brain surgeries over the last eight years to correct two different aneurysm growths.

The Game of Thrones star, 32, said that the surgeries were difficult and not always successful, nor was her recovery — at one point she wanted to “pull the plug” when she was unable to remember her name.

Clarke, sharing her story for the first time in an essay for The New Yorker, said that her health problems started in February 2011, soon after wrapping filming on the HBO show’s first season. She was working out with her trainer in London when she felt a headache forming.

“My trainer had me get into the plank position, and I immediately felt as though an elastic band were squeezing my brain,” she wrote. “I tried to ignore the pain and push through it, but I just couldn’t. I told my trainer I had to take a break. 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.”

Clarke said she remembers a woman asking if she was okay, and then sirens as an ambulance came to rush her to the hospital. On her way there, “a fog of unconsciousness” limited her awareness, and she was sent for an MRI.

“The diagnosis was quick and ominous: a subarachnoid hemorrhage (SAH), a life-threatening type of stroke, caused by bleeding into the space surrounding the brain,” she said. “I’d had an aneurysm, an arterial rupture. As I later learned, about a third of SAH patients die immediately or soon thereafter. For the patients who do survive, urgent treatment is required to seal off the aneurysm, as there is a very high risk of a second, often fatal bleed. If I was to live and avoid terrible deficits, I would have to have urgent surgery. And, even then, there were no guarantees.”

RELATED VIDEO: Emilia Clarke Encourages Young Girls to Pursue Happiness and Not Worry About the Haters: ‘You Do You’

The three-hour surgery was “minimally invasive,” Clarke said, and did not require opening up her skull. But “the pain was unbearable” when she woke up.

She spent four days in the intensive care unit before spending another week and a half recovering. Clarke said that two weeks after surgery was an important marker to check her progress, but it did not go well, and she was unable to remember her name.

“I was suffering from a condition called aphasia, a consequence of the trauma my brain had suffered,” she said. “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. I was sent back to the I.C.U. and, after about a week, the aphasia passed. I was able to speak.”

Kit Harington and Emilia Clarke in Game of Thrones | Helen Sloan/HBO More

Clarke was able to leave the hospital and continue working, but she was warned that there was another, smaller aneurysm on the other side of her brain that could “pop” the way the other one had, but doctors said it may also stay dormant. Clarke resumed promoting Game of Thrones, but “was often so woozy, so weak, that I thought I was going to die,” and had to take morphine between interviews at times to manage the pain.