Root nodules are agricultural-important symbiotic plant-microbe composites in which microorganisms receive energy from plants and reduce dinitrogen (N2) 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 (O2) concentration gradient, which reconciles anaerobic N2 fixation with O2-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 O2 gradient of root nodules in the array. The wire array compatibly accommodates N2-fixing symbiotic bacteria, which receive energy and reducing equivalents from inorganic catalysts on microwires, and fix N2 in the air into biomass and free ammonia. A N2 reduction rate up to 6.5 mg N2 per gram dry biomass per hour is observed in the device, about two orders of magnitude higher than the natural counterparts.