Solar nitrogen (N2) fixation is the most attractive way for the sustainable production of ammonia (NH3), but the development of a highly active, long-term stable and low-cost catalyst remains a great challenge. Current research efforts for N2 reduction mainly focus on the metal-based catalysts using the electrochemical approach, while metal-free or solar-driven catalysts have been rarely explored. Herein, on the basis of a concept of electron "acceptance-donation", a metal-free photocatalyst, namely, boron (B) atom, decorated on the optically active graphitic-carbon nitride (B/g-C3N4), for the reduction of N2 is proposed by using extensive first-principles calculations. Our results reveal that gas phase N2 can be efficiently reduced into NH3 on B/g-C3N4 through the enzymatic mechanism with a record low onset potential (0.20 V). Moreover, the B-decorated g-C3N4 can significantly enhance the visible light absorption, rendering them ideal for solar-driven reduction of N2. Importantly, the as-designed catalyst is further demonstrated to hold great promise for synthesis due to its extremely high stability. Our work is the first report of metal-free single atom photocatalyst for N2 reduction, offering cost-effective opportunities for advancing sustainable NH3 production.