The ternary nitride Gd2Co17Nx (with x close to 3) was prepared by charging Gd2Co17 with nitrogen gas. We have studied this compound by means of X-ray diffraction, magnetic measurements and 155Gd Mössbauer spectroscopy. Upon charging, there is an increase in unit-cell volume of about 6.3%. The preferred moment direction changes from easy plane to easy axis and there is a small reduction in the Co-sublattice moment. From the analysis of the 155Gd Mössbauer spectrum of Gd2Co17Nx it is derived that the electric-field gradient at the Gd nuclei is 14.9 × 1021 V/m2, which is somewhat larger than that found at the Gd sites in Gd2Fe17Nx. The experimental value of Vzz is in good agreement with self-consistent band structure calculations made for Gd2Co17 and its ternary nitride. The results of these calculations have also been used to discuss the changes in magnetic moment upon nitrogen take-up.