Highly stable and efficient bifunctional air cathode catalyst is crucial to rechargeable metal-air batteries. Herein, a ternary nanoalloy layer composed of noble and base metal coated on a three-dimensional porous Ni sponge as the bifunctional cathode is synthesized through in-situ anchoring strategy, which can effectively keep the multi-metal nanoparticles from agglomeration and improve the density of active sites and catalytic activity. The prepared catalyst displays an excellent catalytic performance with lower overpotential and long-term stability. The Zn-air batteries with the as-prepared cathodes possess a large power density of 170 mW/cm2, long cycling stability up to 230 cycles, and a high specific capacity of 771 mA·h/g. Furthermore, the corresponding Li-air batteries deliver a discharge capacity of 22429 mA·h/g. These superior properties of the metal-air batteries can be attributed to the combined influence of design and composition of electrode, which is of great significance to improve the electrochemical catalytic activity, providing great potential of wide application in expanded rechargeable energy systems.