A promising anode material for Li-ion batteries based on MgH₂ with around 5 nm average particles size was synthesized by a bottom-up method. A series of several composites containing MgH₂ nanoparticles well dispersed into a porous carbon host has been prepared with different metal content up to 70 wt%. A narrow particle size distribution (1-10 nm) of the MgH₂ nanospecies with around 5.5 nm average size can be controlled up to 50 wt% Mg. After a ball milling treatment under Ar, the composite containing 50 wt% Mg shows an impressive cycle life stability with a good electrochemical capacity of around 500 mA h g(-1). Moreover, the nanoparticles' size distribution is stable during cycling.