New fabrication techniques have generated interest in the use of impurity-doped diamond as an active material in electronic devices. In this paper we study the properties of the n-type impurities nitrogen and phosphorus in diamond, using a first-principles cluster approach based on the local-density approximation. We determine impurity-donor-level positions of 0.75 and 1.09 eV, respectively, for C:N and C:P, measured relative to the bottom of the conduction band. We also study the energetics of impurity-atom relaxation along the 111 direction in the diamond lattice. While experimental observations indicate a trigonal distortion about the impurity site, we find the on-center position for both impurity atoms to be stable against simple off-center relaxation.