Magnesium is essential for cellular life, but how it is homeostatically controlled still remains poorly understood. Here, we report that members of CNNM family, which have been controversially implicated in both cellular Mg2+ influx and efflux, selectively bind to the TRPM7 channel to stimulate divalent cation entry into cells. Coexpression of CNNMs with the channel markedly increased uptake of divalent cations, which is prevented by an inactivating mutation to the channel's pore. Knockout (KO) of TRPM7 in cells or application of the TRPM7 channel inhibitor NS8593 also interfered with CNNM-stimulated divalent cation uptake. Conversely, KO of CNNM3 and CNNM4 in HEK-293 cells significantly reduced TRPM7-mediated divalent cation entry, without affecting TRPM7 protein expression or its cell surface levels. Furthermore, we found that cellular overexpression of phosphatases of regenerating liver (PRLs), known CNNMs binding partners, stimulated TRPM7-dependent divalent cation entry and that CNNMs were required for this activity. Whole-cell electrophysiological recordings demonstrated that deletion of CNNM3 and CNNM4 from HEK-293 cells interfered with heterologously expressed and native TRPM7 channel function. We conclude that CNNMs employ the TRPM7 channel to mediate divalent cation influx and that CNNMs also possess separate TRPM7-independent Mg2+ efflux activities that contribute to CNNMs' control of cellular Mg2+ homeostasis.