We have studied the structural and electronic properties of the (001) surface of ScN by first-principles total-energy calculations. Since experimental scanning tunneling microscope (STM) images indicate a (1x1) periodicity, we have restricted our calculations to models compatible with this periodicity. Several structures were considered in our study. It was found that for a N-rich surface, the most stable configuration corresponds to a relaxed bulk terminated surface. Electronic properties of this surface are similar to those of the bulk and the surface is semiconductor. In contrast, the most favorable configuration for a Sc-rich surface corresponds to a surface with N vacancies in the first layer. In this case the surface is metallic. Our calculations, and predicted bias dependence of STM images, are in good agreement with experiments.