In 2007, doctors discovered an illness that is suspected of being an underlying cause of the historical accounts of demonic possession: Anti-NMDA receptor encephalitis.
It's caused by an attack on the immune system. Symptoms include:
Agitation, paranoia, psychosis, and violent behaviors, seizures and bizarre movements, mostly of the lips and mouth, but also including pedaling motions with the legs or hand movements resembling playing a piano. Some other symptoms typical during the disease onset include impaired cognition, memory deficits, and speech problems including aphasia, perseveration or mutism.