The Fischer–Tropsch synthesis (FTS) is a feasible pathway to chemicals and fuels from underutilized resources like coal, natural gas, biomass, and shale gas, instead of the current petroleum-based production. Owing to its high activity and low price, the iron-based catalysts are widely used in FTS, yet catalysts with higher activity and better selectivity should be developed for widespread applications. Herein, we report a unique strategy to synthesize an efficient iron catalyst for FTS by applying a graphitic carbon nitride (g-C3N4) as a sacrificial support. The iron catalyst on g-C3N4 is effectively reduced to a state that is rapidly and selectively converted to highly crystalline and pure Hagg carbide (χ-Fe5C2) phase during the FTS reaction. The obtained catalyst exhibits outstanding CO conversion, and high selectivity for C5+ products, outperforming most of the recently reported carbon-based iron catalysts.