The pineal gland is a brain structure that controls circadian rhythms, or day-night cycles. It is a small, pinecone-shaped gland located near the center of the brain in a structure called the epithalamus. The pineal gland sits along the brain's midline, between the two hemispheres. Perhaps because of its central location, the 17th-century philosopher René Descartes believed that the pineal gland was the "seat of the soul"; however, there is no evidence that the pineal gland or its secretions play any important role in cognition or spirituality.
Unlike most of the brain, the pineal gland is not isolated from the blood supply by the blood-brain barrier, but has a plentiful supply of blood vessels. The pineal gland consists mainly of cells called pinealocytes. These branching cells contain several long processes that extend out to the gland's blood vessels. Pinealocytes produce and secrete the hormone melatonin. Melatonin is a pineal hormone that regulates circadian rhythms; its production increases in the dark.The pineal gland receives input from the visual system via the sympathetic nervous system, and this input increases melatonin production in the dark and inhibits melatonin production in the light.