Nitrogen-doped titania has been demonstrated to be a promising photocatalyst in the effective chemical utilization of solar energy. For the synthesis of this photocatalyst, thermal nitridation of titania by ammonia has been frequently used. Our detailed investigation of this nitridation reaction by time-resolved in-situ XRD revealed a smooth transition from the anatase or rutile phase to a cubic TiN phase and incorporation of nitrogen into the interstitial sites of titania. Ex-situ characterizations of the synthesized nitrogen-doped titania using XPS and NEXAFS support the interstitial incorporation mechanism, while the substitution mechanism cannot completely be excluded. A comprehensive analysis of the data suggests that the incorporated nitrogen may form N2-like species embedded in the titania lattice, which is in agreement with the instability of the incorporated nitrogen atoms found by DFT calculations. The research carried out at Brookhaven National Laboratory was supported under contract DE-AC02-98CH10886 with the U.S. Department of Energy.