In 2018, data from a surveillance study in Botswana evaluating adverse birth outcomes raised concerns that women on antiretroviral therapy (ART) containing dolutegravir (DTG) may be at increased risk for neural tube defects (NTDs). The mechanism of action for DTG involves chelation of Mg2+ions in the active site of the viral integrase. Plasma Mg2+homeostasis is maintained primarily through dietary intake and reabsorption in the kidneys. Inadequate dietary Mg2+intake over several months results in slow depletion of plasma Mg2+and chronic latent hypomagnesemia, a condition prevalent in women of reproductive age worldwide. Mg2+is critical for normal embryonic development and neural tube closure. We hypothesized that DTG therapy might slowly deplete plasma Mg2+and reduce the amount available to the embryo, and that mice with pre-existing hypomagnesemia due to genetic variation and/or dietary Mg2+insufficiency at the time of conception and initiation of DTG treatment would be at increased risk for NTDs. We used two different approaches to test our hypothesis: 1) we selected mouse strains that had inherently different basal plasma Mg2+levels and 2) placed mice on diets with different concentrations of Mg2+. Plasma and urine Mg2+were determined prior to timed mating. Pregnant mice were treated daily with vehicle or DTG beginning on the day of conception and embryos examined for NTDs on gestational day 9.5. Plasma DTG was measured for pharmacokinetic analysis. Our results demonstrate that hypomagnesemia prior to conception, due to genetic variation and/or insufficient dietary Mg2+intake, increases the risk for NTDs in mice exposed to DTG. We also analyzed whole-exome sequencing data from inbred mouse strains and identified 9 predicted deleterious missense variants in Fam111a that were unique to the LM/Bc strain. Human FAM111A variants are associated with hypomagnesemia and renal Mg2+wasting. The LM/Bc strain exhibits this same phenotype and was the strain most susceptible to DTG-NTDs. Our results suggest that monitoring plasma Mg2+levels in patients on ART regimens that include DTG, identifying other risk factors that impact Mg2+homeostasis, and correcting deficiencies in this micronutrient might provide an effective strategy for mitigating NTD risk.