Nanoscale or colloidal particles are important in many realms of science and technology. They can dramatically change the properties of materials, imparting solid-like behaviour to a wide variety of complex fluids1, 2. This behaviour arises when particles aggregate to form mesoscopic clusters and networks. The essential component leading to aggregation is an interparticle attraction, which can be generated by many physical and chemical mechanisms. In the limit of irreversible aggregation, infinitely strong interparticle bonds lead to diffusion-limited cluster aggregation3 (DLCA). This is understood as a purely kinetic phenomenon that can form solid-like gels at arbitrarily low particle volume fraction4, 5. Far more important technologically are systems with weaker attractions, where gel formation requires higher volume fractions. Numerous scenarios for gelation have been proposed, including DLCA6, kinetic or dynamic arrest4, 7, 8, 9, 10, phase separation5, 6, 11, 12, 13, 14, 15, 16, percolation4, 12, 17, 18 and jamming8. No consensus has emerged and, despite its ubiquity and significance, gelation is far from understood—even the location of the gelation phase boundary is not agreed on5. Here we report experiments showing that gelation of spherical particles with isotropic, short-range attractions is initiated by spinodal decomposition; this thermodynamic instability triggers the formation of density fluctuations, leading to spanning clusters that dynamically arrest to create a gel. This simple picture of gelation does not depend on microscopic system-specific details, and should thus apply broadly to any particle system with short-range attractions. Our results suggest that gelation—often considered a purely kinetic phenomenon4, 8, 9, 10—is in fact a direct consequence of equilibrium liquid–gas phase separation5, 13, 14, 15. Without exception, we observe gelation in all of our samples predicted by theory and simulation to phase-separate; this suggests that it is phase separation, not percolation12, that corresponds to gelation in models for attractive spheres.