The ultraviolet spectrum of a comet's coma is dominated by emissions from the dissociation products of water, OH, H and O, and from secondary species: C, C+, CO, CO+, CO+2, S, and CS (ref. 1). We report here two far ultraviolet observations of comet Halley made on 26 February 1986 and 13 March 1986 with a sounding rocket experiment. This is the first time that long-slit spectroscopy, a standard technique for the study of extended objects such as comets and nebulae, has been applied to the far ultraviolet study of a comet. The observed CO spatial profiles can be modelled by a radial outflow model2 for a parent molecule and suggest that the CO is produced directly from the nucleus of the comet. Using the observed O I emission profile to deduce the H2O production rate, the abundance of CO relative to H2O is found to be 20 +/- 5% for the first flight and 17 +/- 4% for the second flight, making CO the second most abundant parent molecule in the coma. The derived production rate of atomic carbon is consistent with that expected from the photodissociation of carbon monoxide.