Emilia Clarke has opened up for the first time about suffering two separate brain aneurysms in her twenties, during the filming of Game of Thrones.

In an essay for the New Yorker, Clarke reveals she underwent several secret operations during GoT seasons one and two and almost didn’t survive.

Recalling the horrific day she suffered her first aneurysm at the gym, Clarke writes:

“On the morning of February 11, 2011, I was getting dressed in the locker room of a gym in Crouch End, North London, when I started to feel a bad headache coming on.

“I was so fatigued that I could barely put on my sneakers. When I started my workout, I had to force myself through the first few exercises.

“Then my trainer had me get into the plank position, and 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. I told my trainer I had to take a break.”

Then just 24, Clarke said she dragged herself to the locker room, where she was violently ill. A fellow gym-goer called an ambulance, and her parents, who met her at the hospital.

After being sent for an MRI brain scan, the actress was given the diagnosis, “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.”

“As I later learned,” she said, “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.”

Waking from the operation, Clarke was in “unbearable” pain.

“I had no idea where I was. My field of vision was constricted. There was a tube down my throat and I was parched and nauseated. They moved me out of the I.C.U. after four days and told me that the great hurdle was to make it to the two-week mark. If I made it that long with minimal complications, my chances of a good recovery were high.

“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 became, at her lowest points, suicidal.

“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 slowly recovered from the operation, but her health troubles were far from over. She had a second, smaller aneurysm that could “pop at any time,” had to have continual brain scans to monitor it. It was at one such appointment, in New York City, that doctors told her it had “doubled in size” and that they had to act now.

“When they woke me, I was screaming in pain,” she said. “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. This time they needed to access my brain in the old-fashioned way—through my skull. And the operation had to happen immediately.”

In the end, after months of recovery during which she endured chronic exhaustion, Clarke eventually returned to full health, and went on to wow fans and critics with her powerful performance as Daenerys Targaryen season after season.

As Game of Thrones comes to an end, Clarke said it’s hard to feel sad about the chapter of her life ending. She’s just glad to be entering a new chapter at all.