An effective route based on space-confined chemical reaction to synthesize uniform Li2Mg(NH)2 nanoparticles is reported. The hierarchical pores inside the one-dimensional carbon nanofibers (CNFs), induced by the creation of well-dispersed Li3N, serve as intelligent nanoreactors for the reaction of Li3N with Mg-containing precursors, resulting in the formation of uniformly discrete Li2Mg(NH)2 nanoparticles. The nanostructured Li2Mg(NH)2 particles inside the CNFs are capable of complete hydrogenation and dehydrogenation at a temperature as low as 105 °C with the suppression of ammonia release. Furthermore, by virtue of the nanosize effects and space-confinement by the porous carbon scaffold, no degradation was observed after 50 de/rehydrogenation cycles at a temperature as low as 130 °C for the as-prepared Li2Mg(NH)2 nanoparticles, indicating excellent reversibility. Moreover, the theoretical calculations demonstrate that the reduction in particle size could significantly enhance the H2 sorption of Li2Mg(NH)2 by decreasing the relative activation energy barrier, which agrees well with our experimental results. This method could represent an effective, general strategy for synthesizing nanoparticles of complex hydrides with stable reversibility and excellent hydrogen storage performance.