An endocrine gland located between the two cerebral hemispheres and connected to the forebrain by a stalk. In humans and other mammals it produces the hormone melatonin during the hours of darkness on a circadian (24-hour) cycle, according to timing signals received from two structures in the left and right hypothalamus, the suprachiasmatic nuclei (see biological clock). In many other vertebrates the equivalent structure is the pineal sac, which may be associated with a light-sensitive median eye.