NH3 synthesis by the electrocatalytic N2 reduction reaction (NRR) under ambient conditions is regarded as an appealing alternative to the industrial method that requires high temperature and pressure. Finding a material that can efficiently catalyze electrochemical N2 fixation at ambient condition is a subject of considerable current interest. Atomically dispersed catalysts with mononuclear metal complexes or single metal atoms anchored on supports would be a promising candidate, because of their maximum atom efficiency, unique catalytic performances, and the similarity of the metal coordination environment to the ligand fields in molecular catalysts. A series of cost-effective and optimized atomically-dispersed eletrocatalysts for NRR will be reported. Our results show that the catalysts are featured with high density of single metal atoms supported on hierarchically porous carbon frameworks. They exhibited remarkable selectivity of NH3 formation and high NH3 yield rate at low applied potentials at room temperature. Moreover, the catalysts show negligible activity decay in an NRR electrolysis as long as 50,000 s. On the basis of our results and the previously reported work, a possible mechanism for NRR on the catalyst will be proposed to provide a fundamental insight into the high-efficiency NRR.