Melatonin is produced by a small gland in the brain called the pineal gland. During times of stress, use of certain medications, and increasing age, melatonin production may be disrupted or weakened. This may cause sleep disturbance. Many of the drugs used for pain, anesthesia, or cancer treatment may affect the body's natural secretion of melatonin.