A unique general, large-scale, simple, and cost-effective strategy, i.e., foaming-assisted electrospinning, for fabricating various transition metal oxides into ultrafine nanoparticles (TMOs UNPs) that are uniformly embedded in hierarchically porous carbon nanofibers (HPCNFs) has been developed. Taking advantage of the strong repulsive forces of metal azides as the pore generator during carbonization, the formation of uniform TMOs UNPs with homogeneous distribution and HPCNFs is simultaneously implemented. The combination of uniform ultrasmall TMOs UNPs with homogeneous distribution and hierarchically porous carbon nanofibers with interconnected nanostructure can effectively avoid the aggregation, dissolution, and pulverization of TMOs, promote the rapid 3D transport of both Li ions and electrons throughout the whole electrode, and enhance the electrical conductivity and structural integrity of the electrode. As a result, when evaluated as binder-free anode materials in Li-ion batteries, they displayed extraordinary electrochemical properties with outstanding reversible capacity, excellent capacity retention, high Coulombic efficiency, good rate capability, and superior cycling performance at high rates. More importantly, the present work opens up a wide horizon for the fabrication of a wide range of ultrasmall metal/metal oxides distributed in 1D porous carbon structures, leading to advanced performance and enabling their great potential for promising large-scale applications.