Inorganic polymers (geopolymers) were synthesized by alkali activation of water treatment residue, a waste material containing aluminosilicates and a significant concentration of iron in the form of a ferric nanoparticle oxide gel. The effect on the structures of these geopolymers of incorporating the heavy metals chromium, zinc and iron, as occur in industrial wastewaters, was studied by their addition at the geopolymer synthesis stage, both as the pre-prepared hydroxides and as 1 M nitrate solutions. The heavy metals form several new crystalline phases, but the geopolymers display typical solid-state 27Al and 29Si MAS NMR characteristics. The 28-day strengths of the geopolymers without the metals (up to 11.2 MPa) were significantly degraded by the presence of the heavy metals, particularly 1 M zinc nitrate solution. The deleterious effect of the heavy metals on the strength may arise from their presence as the hydroxides rather than their incorporation as charge-balancing cations in the geopolymer structure. Leaching tests in simulated acid rain indicate that the geopolymers with molar ratios of SiO2/Al2O3 = 1.78 are capable of immobilizing all three metals to within safe leachate levels. The geopolymers are sufficiently strong to withstand handling and transportation and are capable of immobilizing wastes containing these heavy metals for storage or disposal.