A New York magazine news report provides a closer look at what it’s like to have sleep paralysis.

It didn’t happen every night, but every now and then, Blake Smith, a 45-year-old writer and programmer from Kennesaw, Georgia, would jolt awake, believing he was under attack. Just what exactly was attacking him was something of a mystery, as it was invisible — a ghost, maybe. Whatever it was, he could feel that it meant him harm.

What was really happening, he now knows, was that he was experiencing sleep paralysis, a phenomenon that occurs either upon falling asleep or awakening and is thought to be a mix-up of normal REM sleep. On the one hand, people who experience it are, in some sense, conscious and aware — they can see that they’re in their bedroom, for example. But some part of their body still thinks they’re asleep — in particular, their muscles are essentially paralyzed, something that happens in REM sleep. It’s thought to be an evolutionary mechanism that prevents people from acting out their dreams.