NbN x layers were deposited by reactive magnetron sputtering on MgO(001) substrates in 0.67 Pa pure N 2 at T s = 600-1000 °C. T s ≥ 800 °C leads to epitaxial layers with a cube-on-cube relationship to the substrate: (001) NbN ||(001) MgO and [100] NbN ||[100] MgO. The layers are nearly stoichiometric with x = 0.95-0.98 for T s ≤ 800 °C, but become nitrogen deficient with x = 0.81 and 0.91 for T s = 900 and 1000 °C. Xray diffraction reciprocal space maps indicate a small in-plane compressive strain of-0.0008±0.0004 for epitaxial layers, and a relaxed lattice constant that decreases from 4.372 Å for x = 0.81 to 4.363 Å for x = 0.98. This unexpected trend is attributed to increasing Nb and decreasing N vacancy concentrations, as quantified by first-principles calculations of the lattice parameter vs point defect concentration, and consistent with the relatively small calculated formation energies for N and Nb vacancies of 1.00 and-0.67 eV at 0 K and-0.53 and 0.86 eV at 1073 K, respectively. The N-deficient NbN 0.81 (001) layer exhibits the highest crystalline quality with in-plane and out-of-plane x-ray coherence lengths of 4.5 and 13.8 nm, attributed to a high Nb-adatom diffusion on a N-deficient growth front. However, it also contains inclusions of hexagonal NbN grains which lead to a relatively high measured hardness H = 28.0±5.1 GPa and elastic modulus E = 406±70 GPa. In contrast, the nearly stoichiometric phase-pure epitaxial cubic NbN 0.98 (001) layer has a H = 17.8±0.7 GPa and E = 315±13 GPa. The latter value is slightly smaller than 335 and 361 GPa, the isotropic elastic modulus and the [100]-indentation modulus, respectively, predicted for NbN from the calculated c 11 = 641 GPa, c 12 = 140 GPa, and c 44 = 78 GPa. The electrical resistivity ranges from 171-437 μΩ-cm at room temperature and 155-646 μΩ-cm at 77 K, suggesting carrier localization due to disorder from vacancies and crystalline defects.