Li-CO2 batteries are a promising energy storage system, while their practical application is still restricted by a lack of high-performance electrocatalysts for CO2 reduction and evolution reaction. Herein, we propose a metal-organic-framework-derived Fe-N-C electrocatalyst for Li-CO2 batteries. Within the Fe-N-C electrocatalyst, abundant Fe-Nx active sites at the molecular level were formed in the porous carbon framework, profiting from a host-guest chemistry strategy between Fe-mIm nanoclusters and metal organic framework precursors in the pyrolysis process. The confinement effect of the metal organic framework host was beneficial to limit the Fe-mIm nanoclusters at the molecular level, thus resulting in the formation of Fe-Nx sites with the high catalytic activity. Moreover, the as-prepared Fe-N-C catalyst is composed of dodecahedral nanoparticles stacking to form a unique three-dimensional structure with a large specific surface area and sufficient space, which not only favored the electron transport and CO2/Li+ diffusion but also promoted the deposition of discharge product Li2CO3 to ensure a high capacity. Therefore, the Fe-N-C based Li-CO2 battery exhibits high specific capacity (13 238 mA h g-1), good rate capability and excellent cyclability (140 cycles). Therefore, these encouraging results suggest an effective approach to obtain high-performance Fe-N-C electrocatalysts for Li-CO2 batteries.