The mechanism of nitrogenation of Sm2Fe17 was investigated with in-situ high temperature x-ray diffraction with Debye-Scherrer optic using a quartz capillary equipped with an additional buffer volume to supply sufficient nitrogen for the expected phase reaction. The formation of Sm2Fe17Nx with x ≈ 3 was observed at temperatures between 325 °C and 450 °C. During the phase transition period, taking 30–90 min at 450 °C and up to 300 min at 350 °C, two phases were observed simultaneously, a non-nitrided Sm2Fe17 phase and the already fully nitrided Sm2Fe17N3 phase. At 325 °C no single-phase material could be obtained during 300 min. The resulting lattice parameters measured after the complete nitrogenation are the same as those, obtained from the externally nitrogenized samples.