The direct role of melatonin in mammary glands of dairy goats has remained obscure. This study aimed to evaluate the expression of melatonin membrane receptors (MT1 and MT2) in the pituitary and mammary glands of dairy goats during lactation, and to investigate the role of melatonin in mammary function. Both MT1 and MT2 were consistently expressed in the pituitary and mammary eight glands throughout the lactation period, and their levels were lower in 9March (group I), June (group III), and September (group V) than in May (group II) and August (group IV). The expression patterns of pituitary and mammary MT1 and MT2 were consistent with those of blood melatonin during lactation. Furthermore, the mammary prolactin (PRL), and pituitary growth hormone (GH) and PRL mRNA expression showed an... inverse trend in relation to blood melatonin levels. In mammary tissues, MT1 and MT2 immunoreactivity was predominantly located in the mammary epithelial cells (MECs). In addition, a dose- and time-dependent inhibition on cell viability was observed in cultured MECs. At the dose of 10 and 100 pg/ml, melatonin decreased mammary β -casein and PRL expression. Furthermore, the inhibitory effects of melatonin were blocked by luzindole, a nonselective MT1 and MT2 receptor antagonist. In addition, melatonin promoted MT1 and MT2 expression in cultured MECs. In conclusion, the presence of MT1 and MT2 in the pituitary and mammary glands and the inhibitory effects of melatonin on cell viability, β -casein, and PRL expression in MECs suggest the potential regulation by melatonin in goat mammary function.;; Summary Sentence ;;Melatonin directly decreased cell viability, and β -casein and prolactin expression in cultured mammary epithelial cells of lactating dairy goats.