The blood-brain barrier (BBB) is critical for neural function. We report here circadian regulation of the BBB in mammals. Efflux of xenobiotics by the BBB oscillates in mice, with highest levels during the active phase and lowest during the resting phase. This oscillation is abrogated in circadian clock mutants. To elucidate mechanisms of circadian regulation, we profiled the transcriptome of brain endothelial cells; interestingly, we detected limited circadian regulation of transcription, with no evident oscillations in efflux transporters. We recapitulated the cycling of xenobiotic efflux using a human microvascular endothelial cell line to find that the molecular clock drives cycling of intracellular magnesium through transcriptional regulation of TRPM7, which appears to contribute to the rhythm in efflux. Our findings suggest that considering circadian regulation may be important when therapeutically targeting efflux transporter substrates to the CNS.