Bifunctional catalysts for water electrolysis are important for renewable and clean energy transformation processes like fuel cells, lithium−oxygen batteries, and so forth. Despite tremendous efforts, developing efficient bifunctional electrocatalysts with low cost and long‐term durability remains a great challenge. Herein, the synthesis of Co9S8 nanocrystals encapsulated in nitrogen/sulfur‐doped mesoporous graphitized carbon derived from a polymer−metal complex is reported, which exhibit similar electrocatalytic activity and superior stability for water‐splitting reactions (oxygen reduction/oxygen evolution). The remarkable electrochemical properties are mainly attributed to the synergetic effects between Co9S8, heteroatoms and graphitized carbon in alkaline medium, especially for the oxygen evolution reaction. The present strategy to fabricate Co9S8 nanocrystals in nitrogen and sulfur doped carbon using a single‐source precursor offers many prospects in developing highly effective electrocatalysts in rechargeable metal−air batteries.