The history of psychiatry, the medical specialty for mental disorders, traces its roots to Ancient India with texts like the Charaka Samhita and some of the first hospitals established in the 3rd century BCE. While ancient Greece initially viewed mental illness as supernatural, Hippocrates in the 4th century BCE began theorizing physiological causes. During the Middle Ages, Arab countries notably established Bimaristans with dedicated mental wards from the early 9th century, and physicians like Avicenna contributed to the field.
However, specialist hospitals in medieval Europe from the 13th century, such as London's Bethlem Royal Hospital, often served more as custodial institutions for the "distracted" rather than providing treatment. The early modern period saw a proliferation of privately run asylums, and significant intellectual contributions like Robert Burton's 1621 treatise, The Anatomy of Melancholy, which explored the causes and cures of mental illness. This journey reflects a gradual shift from supernatural explanations and confinement towards more medical and analytical approaches to understanding the human mind.