This paper reports the fabrication of three-dimensional porous carbon nanofibers network with high doping level of nitrogen (N, 5.17 at.%) and boron (B, 6.87 at.%) through a general electrospinning strategy followed by a calcination process. The employed ammonia borane (NH3BH3, denote as AB) not only functions as a porogen reagent to generate porous structures but also as the heteroatoms source to induce N and B co-doping. Such highly unique nanoarchitectures offer remarkably improved Li storage performance including high reversible capacity (∼910 mAh g−1 at a current density of 100 mA g−1) with good cycling and rate performances.