AbstractMetal phosphides are appealing candidates for lithium and sodium ion batteries due to their moderate discharge plateau, relatively low polarization and impressive theoretical capacity. Unfortunately, the poor capacity retention and limited cycle life are still big problems as for other phase‐transformation‐type anode materials. Herein, we report a novel one‐dimensional hierarchical material, consisting of carbon‐coated mini hollow FeP nanoparticles homogeneously encapsulated in porous carbon nanofibers (denoted as M‐FeP@C) through a low temperature phosphidation method. The M‐FeP@C hybrid nanofibers deliver high specific capacity, long cycling life stability (542 mAh g−1 after 300 cycles at 1 A g−1) and excellent rate capability for half and full lithium‐ion batteries. In addition, the M‐FeP@C hybrid nanofibers show 474 mAh g−1 after 100 cycles at 0.1 A g−1 as an anode for sodium ion batteries. The outstanding electrochemical performance of the M‐FeP@C hybrid nanofibers for both lithium and sodium storage can be attributed to the advantageous embedding architecture between the mini hollow FeP nanoparticles and double carbon layers scaffold, which offer not only a continuous conducting framework and nanoporous channels for efficient diffusion and transport of ions/electrons, but also provide enough voids to alleviate the volume changes during cycling.