Polymeric nitrogen has been recognized to be a new type of high-energy density material (HEDM). However, the polymeric nitrogen structure formed under high-pressure and high-temperature conditions is usually in poor thermodynamic stability. Confinement strategy is conductive to the stabilization of the high-pressure phase of polymeric nitrogen structures, providing a new modulation approach for realizing the polymerization of nitrogen. In this work, nitrogen molecules are confined into the boron nitride nanotubes (N
2@BNNTs) under high-pressure condition. The pressure-induced polymerization of nitrogen in N
2@BNNT samples with varying nitrogen content and the stabilities of polymeric nitrogen structure are characterized by high-pressure
in situRaman spectroscopy method. In the N
2@BNNT sample with higher nitrogen content, the N
2confined to boron nitride nanotubes exhibits different Raman spectral pressure response behaviors compared with that of non confined N
2, but both of them are transformed into cg-N structure after laser heating at about 123 GPa. With pressure decreasing to 40 GPa, the unconfined cg-N decomposes and releases huge energy, which affects the stability and results in the decomposition of the confined cg-N. Under ambient conditions, the confined N
2is stabilized in the liquid phase. In the N
2@BNNTs sample with lower nitrogen content, the confined N
2is transformed into new polymeric nitrogen structure, which possesses N=N double bonds with different bond lengths close to the those in the
${\mathrm{N}}_3^- $
anion and
${\mathrm{N}}_4^+ $
clusters, respectively, after laser-heating in the pressure range of 122–150 GPa. This polynitrogen structure is stable with pressure decreasing to 25 GPa. This work provides new insights into the synthesis and stabilization of polymeric nitrogen structures, opening up new avenues for developing these advanced structures.