Root nodules are agricultural-important symbiotic plant-microbe composites in which microorganisms receive energy from plants and reduce dinitrogen (N 2 ) into fertilizers. Mimicking root nodules using artificial devices can enable renewable energy-driven fertilizer production. This task is challenging due to the necessity of a microscopic dioxygen (O 2 ) concentration gradient, which reconciles anaerobic N 2 fixation with O 2 -rich atmosphere. Here we report our designed electricity-powered biological|inorganic hybrid system that possesses the function of root nodules. We construct silicon-based microwire array electrodes and replicate the O 2 gradient of root nodules in the array. The wire array compatibly accommodates N 2 -fixing symbiotic bacteria, which receive energy and reducing equivalents from inorganic catalysts on microwires, and fix N 2 in the air into biomass and free ammonia. A N 2 reduction rate up to 6.5 mg N 2 per gram dry biomass per hour is observed in the device, about two orders of magnitude higher than the natural counterparts.