Dendritic spines of pyramidal neurons in the cerebral cortex undergo activity-dependent structural remodelling that has been proposed to be a cellular basis of learning and memory. How structural remodelling supports synaptic plasticity, such as long-term potentiation, and whether such plasticity is input-specific at the level of the individual spine has remained unknown. We investigated the structural basis of long-term potentiation using two-photon photolysis of caged glutamate at single spines of hippocampal CA1 pyramidal neurons. Here we show that repetitive quantum-like photorelease (uncaging) of glutamate induces a rapid and selective enlargement of stimulated spines that is transient in large mushroom spines but persistent in small spines. Spine enlargement is associated with an increase in AMPA-receptor-mediated currents at the stimulated synapse and is dependent on NMDA receptors, calmodulin and actin polymerization. Long-lasting spine enlargement also requires Ca2+/calmodulin-dependent protein kinase II. Our results thus indicate that spines individually follow Hebb's postulate for learning. They further suggest that small spines are preferential sites for long-term potentiation induction, whereas large spines might represent physical traces of long-term memory.