Abstract The observation of ions created by ionization of cometary gas, either by ground-based observations or by in situmeasurements can give us useful information about the gas production and composition of comets. However, due to the interaction of ions with the magnetized solar wind and their high chemical reactivity, it is not possible to relate measured ion densities (or column densities) directly to the parent gas densities. In order to quantitatively analyze measured ion abundances in cometary comae it is necessary to understand their dynamics and chemistry. We have developed a detailed ion–chemical network of cometary atmospheres. We include production of ions by photo- and electron impact-ionization of a background neutral atmosphere, charge exchange of solar wind ions with cometary atoms/molecules, reactions between ions and molecules, and dissociative recombination of molecular ions with thermal electrons. By combining the ion–chemical network with the three-dimensional plasma flow as computed by a new fully three-dimensional MHD model of cometary plasma environments (Gombosi et al.1996) we are able to compute the density of the major cometary ions everywhere in the coma. The input parameters for our model are the solar wind conditions (density, speed, temperature, magnetic field) and the composition and production rate of the gas. We applied our model to Comet P/Halley in early March 1986, for which the input parameters are reasonably well known. We compare the resulting column density of H 2O +with ground-based observations of H 2O +from DiSanti et al.(1990). The results of our model are in good agreement with both the spatial distribution and the absolute abundance of H 2O +and with their variations with the changing overall water production rate between two days. The results are encouraging that it will be possible to obtain production rates of neutral cometary constituents from observations of their ion products.