Fuel cells, as devices for direct conversion of the chemical energy of a fuel into electricity by electrochemical reactions, are among the key enabling technologies for the transition to a hydrogen-based economy1,2,3. Of several different types of fuel cells under development today, polymer electrolyte fuel cells (PEFCs) have been recognized as a potential future power source for zero-emission vehicles4,5. However, to become commercially viable, PEFCs have to overcome the barrier of high catalyst cost caused by the exclusive use of platinum and platinum-based catalysts6,7,8 in the fuel-cell electrodes. Here we demonstrate a new class of low-cost (non-precious metal)/(heteroatomic polymer) nanocomposite catalysts for the PEFC cathode, capable of combining high oxygen-reduction activity with good performance durability. Without any optimization, the cobalt-polypyrrole composite catalyst enables power densities of about 0.15 W cm-2 in H2-O2 fuel cells and displays no signs of performance degradation for more than 100 hours. The results of this study show that heteroatomic polymers can be used not only to stabilize the non-precious metal in the acidic environment of the PEFC cathode but also to generate active sites for oxygen reduction reaction.