Exploring low-cost, efficacious and stable bifunctional electrocatalysts for both oxygen reduction reaction (ORR) and oxygen evolution reaction (OER) is crucial yet highly challenging to the wide perspective practicability for rechargeable metal−air batteries together with fuel cells and electrochemical water splitting. Herein, we have successfully prepared a novel nanohybrid consisting of Co2P nanocores encased in N,P-codoped carbon layers (denoted as Co2P@NPC) through an extremely facile and effective pyrolysis route utilizing easily available raw materials. The as-prepared Co2P@NPC exhibits excellent bifunctional electrocatalytic performances for both ORR and OER in alkaline solution. For ORR, Co2P@NPC shows comparable activity to the commercial 20 wt% Pt/C in terms of the half-wave potential and limited current density under the identical linear sweep voltammetry measurement conditions. Moreover, the ORR durability and methanol tolerance of Co2P@NPC are much better than those of 20 wt% Pt/C. As regards OER, Co2P@NPC affords lower activity but better stability than the fresh RuO2. The high electrocatalytic performances originate from the strong interaction between Co2P nanocores and N,P-codoped carbon layers, the high BET surface area and the conductive network formed by the crosslinking of carbon coatings.