Neurons in the cerebral cortex are organized into anatomical columns, with ensembles of cells arranged from the surface to the white matter. Within a column, neurons often share functional properties, such as selectivity for stimulus orientation; columns with distinct properties, such as different preferred orientations, tile the cortical surface in orderly patterns. This functional architecture was discovered with the relatively sparse sampling of microelectrode recordings. Optical imaging of membrane voltage or metabolic activity elucidated the overall geometry of functional maps, but is averaged over many cells (resolution >100 microm). Consequently, the purity of functional domains and the precision of the borders between them could not be resolved. Here, we labelled thousands of neurons of the visual cortex with a calcium-sensitive indicator in vivo. We then imaged the activity of neuronal populations at single-cell resolution with two-photon microscopy up to a depth of 400 microm. In rat primary visual cortex, neurons had robust orientation selectivity but there was no discernible local structure; neighbouring neurons often responded to different orientations. In area 18 of cat visual cortex, functional maps were organized at a fine scale. Neurons with opposite preferences for stimulus direction were segregated with extraordinary spatial precision in three dimensions, with columnar borders one to two cells wide. These results indicate that cortical maps can be built with single-cell precision.