During deep REM sleep, your muscles (except those in the eyes) are essentially immobilized in order to keep you from acting out on your dreams. Unfortunately, this effort your body makes to keep you safe while dreaming can sometimes backfire, resulting in sleep paralysis.
Sleep paralysis occurs when the brain is aroused from its REM cycle, but the body remains in its immobilizing state. This can be quite a frightening sensation because, while your mind is slowly regaining consciousness, it has no control over your body, leaving some with a feeling of powerlessness, fear and panic.
Most people experience this eerie phenomena at least once in their lives, but those who are sleep deprived are more likely to have panicked episodes of sleep paralysis that are usually accompanied by hallucinations, as well.