The magnesium ion, Mg2+, is essential for myriad biochemical processes and remains the only major biological ion whose transport mechanisms remain unknown. The CorA family of magnesium transporters is the primary Mg2+ uptake system of most prokaryotes and a functional homologue of the eukaryotic mitochondrial magnesium transporter. Here we determine crystal structures of the full-length Thermotoga maritima CorA in an apparent closed state and its isolated cytoplasmic domain at 3.9Å and 1.85Å resolution, respectively. The transporter is a funnel-shaped homopentamer with two transmembrane helices per monomer. The channel is formed by an inner group of five helices and putatively gated by bulky hydrophobic residues. The large cytoplasmic domain forms a funnel whose wide mouth points into the cell and whose walls are formed by five long helices that are extensions of the transmembrane helices. The cytoplasmic neck of the pore is surrounded, on the outside of the funnel, by a ring of highly conserved positively charged residues. Two negatively charged helices in the cytoplasmic domain extend back towards the membrane on the outside of the funnel and abut the ring of positive charge. An apparent Mg2+ ion was bound between monomers at a conserved site in the cytoplasmic domain, suggesting a mechanism to link gating of the pore to the intracellular concentration of Mg2+.