The ATP-binding cassette G2 (ABCG2) is an efflux transporter expressed in the apical membrane of cells from a large number of tissues, directly affecting bioavailability, tissue accumulation, and secretion into milk of both xenobiotics and endogenous compounds. The aim of this work was to characterize the role of ABCG2 in the systemic distribution and secretion into milk of melatonin and its main metabolites, 6-hydroxymelatonin, and 6-sulfatoxymelatonin. For this purpose, we first showed that these three molecules are transported by this transporter using in vitro transepithelial assays with MDCK-II polarized cells transduced with different species variants of ABCG2. Second, we tested the in vivo effect of murine Abcg2 in the systemic distribution of melatonin and its metabolites using wild-type and Abcg2-/- mice. Our results show that after oral administration of melatonin, the plasma concentration of melatonin metabolites in Abcg2-/- mice was between 1.5 and 6-fold higher compared to the wild-type mice. We also evaluated in these animals differences in tissue accumulation of melatonin metabolites. The most relevant differences between both types of mice were found for small intestine and kidney (>sixfold increase for 6-sulfatoxymelatonin in Abcg2-/- mice). Finally, melatonin secretion into milk was also affected by the murine Abcg2 transporter, with a twofold higher milk concentration in wild-type compared with Abcg2-/- lactating female mice. In addition, melatonin metabolites showed a higher milk-to-plasma ratio in wild-type mice. Overall, our results show that the ABCG2 transporter plays a critical role in the biodistribution of melatonin and its main metabolites, thereby potentially affecting their biological and therapeutic activity.