Phosphorus (P) is an essential component of several core biological molecules. In bacteria, P is mainly acquired as inorganic orthophosphate (Pi). Once in the cytoplasm, Pi is incorporated into adenosine triphosphate (ATP), which exists primarily as a Mg2+ salt. Notably, whereas P is essential, excess of cytosolic Pi hinders growth. Here we demonstrate that cytotoxic effects of excessive Pi uptake result from its assimilation into ATP and subsequent disruption of Mg2+ dependent processes. We show that Salmonella enterica cells experiencing cytoplasmic Mg2+ starvation restrict Pi uptake, thereby limiting the availability of an ATP precursor. This response prevents excessive ATP synthesis, overproduction of ribosomal RNA, chelation of free cytoplasmic Mg2+ and the destabilization of Mg2+-dependent core processes that ultimately hinder bacterial growth and leads to loss of cellular viability. We demonstrate that, even when cytoplasmic Mg2+ is not limiting, excessive Pi uptake leads to increased ATP synthesis, depletion of free cytoplasmic Mg2+, inhibition of translation and growth. Our results establish that bacteria must restrict Pi uptake to prevent the depletion of cytoplasmic Mg2+. Furthermore, they provide a framework to understand the molecular basis of Pi cytotoxicity and reveal a regulatory logic employed by bacterial cells to control P assimilation.