Epstein-Barr virus (EBV) is an oncogenic gammaherpesvirus that infects and persists in 95% of adults worldwide and has the potential to cause fatal disease, especially lymphoma, in immunocompromised hosts. Primary immunodeficiencies (PIDs) that predispose to EBV-associated malignancies have provided novel insights into the molecular mechanisms of immune defense against EBV. We have recently characterized a novel PID now named "X-linked immunodeficiency with magnesium defect, EBV infection, and neoplasia" (XMEN) disease characterized by loss-of-function mutations in the gene encoding magnesium transporter 1 (MAGT1), chronic high-level EBV with increased EBV-infected B cells, and heightened susceptibility to EBV-associated lymphomas. The genetic etiology of XMEN disease has revealed an unexpected quantitative role for intracellular free magnesium in immune functions and has led to novel diagnostic and therapeutic strategies. Here, we review the clinical presentation, genetic mutation spectrum, molecular mechanisms of pathogenesis, and diagnostic and therapeutic considerations for this previously unrecognized disease.