Developing high-performance noble-metal-free electrocatalysts for oxygen reduction reaction (ORR) is the key to the commercialization of fuel cells. Here we use a Fe (III)-modified montmorillonite (Fe-MMT) as a solid-state flat-template to synthesize iron and nitrogen-doped carbon electrocatalysts (FeN/C-PANI) for the ORR derived from thermal conversion of aniline nanopolymer at controlled temperatures. The utilization of flat template can hinder thermal agglomeration of aniline nanopolymer and optimize the nitrogen-containing active site density on the surface. We find that this catalyst exhibits a similar ORR electrocatalytic activity with an onset potential of 0.99 V (versus RHE), a major four-electron reaction pathway and a higher stability compared to the state-of-the-art 20 wt% Pt/C catalyst in alkaline medium. Besides, the ORR half-wave potential measured on our catalyst is only 10 mV lower than that on a Pt/C catalyst. Electrochemical poisoning experiments also confirm that the Fe-Nx group inside the FeN/C-PANI can improve the ORR activity and may be one of key components of active sites. The pyrrolic-N species may be mainly responsible for the ORR catalytic activity and may be another essential component of active sites. This study opens a new way to rationally design inexpensive and highly-efficient ORR catalysts by using simple flat compounds as a direct template.