The dynamic turnover of actin filaments (F-actin) controls cellular motility in eukaryotes and is coupled to changes in the F-actin nucleotide state1–3. It remains unclear how F-actin hydrolyses ATP and subsequently undergoes subtle conformational rearrangements that ultimately lead to filament depolymerization by actin-binding proteins. Here we present cryo-electron microscopy structures of F-actin in all nucleotide states, polymerized in the presence of Mg2+ or Ca2+ at approximately 2.2 Å resolution. The structures show that actin polymerization induces the relocation of water molecules in the nucleotide-binding pocket, activating one of them for the nucleophilic attack of ATP. Unexpectedly, the back door for the subsequent release of inorganic phosphate (Pi) is closed in all structures, indicating that Pi release occurs transiently. The small changes in the nucleotide-binding pocket after ATP hydrolysis and Pi release are sensed by a key amino acid, amplified and transmitted to the filament periphery. Furthermore, differences in the positions of water molecules in the nucleotide-binding pocket explain why Ca2+-actin shows slower polymerization rates than Mg2+-actin. Our work elucidates the solvent-driven rearrangements that govern actin filament assembly and aging and lays the foundation for the rational design of drugs and small molecules for imaging and therapeutic applications.