Three different N-doped ordered porous carbons (CNx) were produced by a nanocasting process using polyaniline as the carbon and nitrogen precursor. A pyrolysis treatment of iron chloride-impregnated CNx under nitrogen is used in the preparation of the carbon composite catalysts, and this is followed by posttreatments and optimization of the iron loading and the pore size. Exploration of the catalytic activity of the CNx products for catalyzing the oxygen reduction reaction (ORR) using rotating disk electrode measurements and single-cell tests shows that the onset potential for ORR of the most effective catalyst in 0.5 M H2SO4 is as high as 0.9 V vs. the normal hydrogen electrode. A proton exchange membrane fuel cell constructed with the catalyst exhibits a current density as high as 0.52 A cm−2 at 0.6 V with 2 atm back pressure using a cathode catalyst loading of 6 mg cm−2. The average pore diameters of synthesized CNx-12, CNx-15, and CNx-16 are 0.7, 4.3, and 14 nm, respectively. It is observed that the pore size and specific surface area are an important factor for increased catalyst activity. The pore size of the most effective catalysts is found to be 4.3 nm.