Noble-metal free and durable electrocatalysts with high catalytic activity toward oxygen reduction and evolution reactions are crucial to high-performance primary or rechargeable Zn-air batteries (ZnABs) and fuel cells. Herein, we report an efficient bifunctional electrocatalyst with core-shell structure obtained from ZIF-8@ZIF-67 through hydrothermal and carbonization treatment. The resulted material, i.e. highly graphitic carbon (GC, carbonized from ZIF-67) on nitrogen-doped carbon (NC, carbonized from ZIF-8) (NC@GC), combines the distinguished advantages of NC, including high surface area, presence of Co doping and high nitrogen content, and those of GC including high crystallinity, good conductivity and stability of GC. This unique core-shell structure with potential synergistic interaction leads to high activities towards oxygen reduction and oxygen evolution reactions. As a proof-of-concept, the as-prepared NC@GC catalyst exhibits excellent performance in the primary and rechargeable ZnABs. This study might inspire new thought on the development of carbon-based electrocatalytic materials derived from MOF materials.