Mature cortical pyramidal neurons receive excitatory inputs onto small protrusions emanating from their dendrites called spines. Spines undergo activity-dependent remodelling, stabilization and pruning during development, and similar structural changes can be triggered by learning and changes in sensory experiences. However, the biochemical triggers and mechanisms of de novo spine formation in the developing brain and the functional significance of new spines to neuronal connectivity are largely unknown. Here we develop an approach to induce and monitor de novo spine formation in real time using combined two-photon laser-scanning microscopy and two-photon laser uncaging of glutamate. Our data demonstrate that, in mouse cortical layer 2/3 pyramidal neurons, glutamate is sufficient to trigger de novo spine growth from the dendrite shaft in a location-specific manner. We find that glutamate-induced spinogenesis requires opening of NMDARs (N-methyl-D-aspartate-type glutamate receptors) and activation of protein kinase A (PKA) but is independent of calcium-calmodulin-dependent kinase II (CaMKII) and tyrosine kinase receptor B (TrkB) receptors. Furthermore, newly formed spines express glutamate receptors and are rapidly functional such that they transduce presynaptic activity into postsynaptic signals. Together, our data demonstrate that early neural connectivity is shaped by activity in a spatially precise manner and that nascent dendrite spines are rapidly functionally incorporated into cortical circuits.