In this work, taking the advantage of the interaction between the basic groups on the surface of the Mo(VI)-melamine polymer and the acidic groups on the surface of the oxidized CNTs, the two segments can combine together tightly by electrostatic attraction. After subsequent calcination, the Mo2C NPs supported on nitrogendoped CNTs (Mo2C/NCNT) are obtained. The obtained materials exhibit high activity and long-term stability for both HER and ORR. The outstanding activity can be attributed to the inherent catalytic activity of Mo2C NPs and the N-doped CNTs. This work provides a new strategy for preparing Mo2C electrocatalysts, which will promote the applications for high-performance electrocatalytic technologies.