Silicon-based anodes have recently received increased attentions due to their high theoretical capacity. However, the Sibased anodes always suffer large volume change during cycling and require expensive and multistep processes to prepare nano-sized Si. In this work, Si nanoparticles are successfully embedded in carbon matrix by using NaCl particles as a hard template, which were prepared through magnesiothermic reduction of SiO2 nanoparticles. Besides, NaCl particles also play an important role in absorbing the local heat accumulation generated from magnesiothermic reduction, thus preventing the agglomeration of Si particles and the formation of undesirable SiC. The as-prepared Si@PCM could not only provide fast electrons diffusion through carbon network, but also accommodate the stress-strain caused by volume change. As a result, the Si@PCM composite demonstrates an excellent electrochemical performance as an anode material for lithiumion batteries.