The irreversible evolution of a microscopic system under measurement is a central feature of quantum theory. From an initial state generally exhibiting quantum uncertainty in the measured observable, the system is projected into a state in which this observable becomes precisely known. Its value is random, with a probability determined by the initial system's state. The evolution induced by measurement (known as 'state collapse') can be progressive, accumulating the effects of elementary state changes. Here we report the observation of such a step-by-step collapse by measuring non-destructively the photon number of a field stored in a cavity. Atoms behaving as microscopic clocks cross the cavity successively. By measuring the light-induced alterations of the clock rate, information is progressively extracted, until the initially uncertain photon number converges to an integer. The suppression of the photon number spread is demonstrated by correlations between repeated measurements. The procedure illustrates all the postulates of quantum measurement (state collapse, statistical results and repeatability) and should facilitate studies of non-classical fields trapped in cavities.