In an essay written for The New Yorker, Emilia Clarke has revealed the serious health struggles she faced while filming Game of Thrones.

Shortly after production wrapped for Season 1 in 2011, Clarke remembers collapsing at the gym following a severe headache. The incident would mark the beginning of the first of two major surgeries for Clarke, each tied to a life-threatening brain aneurysm.

"At some level, I knew what was happening: my brain was damaged," Clarke recalls.

"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. I’d had an aneurysm, an arterial rupture."

The severity of the situation was made more grave by the statistics. Clarke explains, "about a third of SAH patients die immediately or soon thereafter."

For the first week following her first surgery, Clarke struggled with aphasia — a fairly common consequence of brain trauma that impairs a patient's ability to comprehend or produce language.

She was also warned of a second smaller aneurysm on the other side of her brain, one doctors warned could "'pop' at anytime."

"I am an actor; I need to remember my lines. Now I couldn’t recall my name."

"I could see my life ahead, and it wasn’t worth living," Clarke recounts. "I am an actor; I need to remember my lines. Now I couldn’t recall my name."

The aphasia eventually passed, but Clarke's battle with her brain health would continue for years.

As she struggled to keep up with the long and painful process of recovery as well as her rigorous Game of Thrones production schedule, Clarke recalls feeling as though her performance was slipping.

"Season 2 would be my worst. I didn’t know what Daenerys was doing. If I am truly being honest, every minute of every day I thought I was going to die."

After Clarke wrapped Season 3 of Game of Thrones, she underwent surgery for her second aneurysm. While the first procedure had been minimally invasive, the second was more severe.

"I looked as though I had been through a war more gruesome than any that Daenerys experienced," Clarke describes. "I emerged from the operation with a drain coming out of my head. Bits of my skull had been replaced by titanium."

The road to complete rehabilitation would be long, but now — just weeks before the premiere of Game of Thrones' eighth and final season — Clarke is "at a hundred percent."

The publication of the essay accompanies the launch of Clarke's not for profit organization SameYou, a charity aiming to provide treatment for patients recovering from brain injuries and strokes.

"There is something gratifying, and beyond lucky, about coming to the end of Thrones," Clarke says. "I’m so happy to be here to see the end of this story and the beginning of whatever comes next."

Read Clarke's full essay in The New Yorker and learn more about SameYou here.