A well-designed material comprising Co3O4 nanoparticles embedded in one-dimensional porous nitrogen-doped carbon nanofibers (Co3O4@NCNFs) is prepared through electrospinning, immersion in a cobalt-containing zeolitic imidazolate frameworks (ZIF-67/ZIF-8) and follows by calcination and oxidation. The resultant sample displays a high discharge capacity of 332 mAh g−1 after 200 cycles at a current density of 100 mA g−1 and an outstanding long-term performance (181 mAh g−1 at 1 A g−1 over 1000 cycles), which is better than the reported high current density for Co3O4-based materials. The excellent electrochemical performance is attributed to the nanostructure comprising Co3O4 nanoparticles homogeneously embedded in nitrogen-doped carbon nanofibers, which can effectively inhibit the aggregation of Co3O4 nanoparticles, accommodate the volume change during charge and discharge processes and provide high electrical conductivity of the electrode. This work provides a facile method to obtain one-dimensional oxide composites with high electrochemical performance using a new metal-organic framework as the sacrificial template.