A new porous composite nanofiber manufacturing route, combining electrospinning and foaming processes, was developed. In this process, aluminum acetylacetonate (AACA) was introduced as the foaming agent in nanofibers made of polyacrylonitrile (PAN)/silicon (Si) nanoparticles. PAN/Si composite nanofibers were first produced through an electrospinning process and mesopores were then generated by foaming nanofibers via AACA sublimation. After further carbonization, the obtained mesoporous carbon/silicon composite nanofiber mats were tested as the anode material for lithium ion batteries. Within this composite anode, mesopores provide needed buffering space to accommodate the large volume expansion and consequent stress induced inside silicon during lithiation. This effectively mitigates silicon pulverization issue and helps achieve higher reversible capacity and better capacity retention in later battery tests when compared with anodes made of nonporous composites nanofibers and carbon nanofibers alone.