The role of the protective gases in laser-based powder bed fusion (L-PBF) is mainly to avoid the oxidation of metals during the melting and solidification process. However, the gaseous environment can also interact with metals, and result in changes in microstructure and properties. In a NiTi alloy, we found the L-PBF processes in the N2 gaseous environment can induce TiN particles and facilitate the formation of a precipitate-dislocation network and therefore improve mechanical properties. Nitrogen segregation also led to grain refinement and the generation of high-angle grain boundaries. The as-printed NiTi in N2 loses its shape memory effect, however, an aging process at 500 °C resulted in unchanged grain size, parallel arrays of Ni4Ti3 precipitates around TiN, and a recovery of shape memory effect. The optimization of microstructure finally resulted in a high hardness of ∼4.0 GPa and a low reduced elastic modulus of ∼57.5 GPa. The manufacturing process presented in this study opens a new way for making biomedical devices with low elastic constant, high strength to weight, and high resistance to wear.