Melatonin is a hormone secreted from the pineal gland. It was discovered in 1958. A professor from Yale University and his colleagues were researching. It was performed to find the cure for skin disorders. This research revolved around compounds present in the gland. Thus, they found Melatonin. It was tested on cows with success.
Melatonin is a hormone that human brain produces. The pineal gland situated above the cerebellum in the brain is the source for Melatonin.
Regulation of Melatonin production follows solar timing. With the sun setting, brain signals the gland to secrete Melatonin. When the night darkens, its level increases. This induces a person to deep sleep by midnight. It is the reason we get sound sleep during night.