Li3N is an excellent protective coating material for lithium electrodes with very high lithium-ion conductivity and low electronic conductivity, but the formation of stable and homogeneous coatings is technically very difficult. Here, we show that protective Li3N coatings can be simply formed by the direct reaction of electrodeposited lithium electrodes with N2 gas, whereas using battery-grade lithium foil is problematic due to the presence of a native passivation layer that hampers that reaction. The protective Li3N coating is effective at preventing lithium dendrite formation, as found from unidirectional plating and plating-stripping measurements in Li-Li cells. The Li3N coating also efficiently suppresses the parasitic reactions of polysulfides and other electrolyte species with the lithium electrode, as demonstrated by scanning transmission X-ray microscopy, X-ray photoelectron spectroscopy, and optical microscopy. The protection of the lithium electrode against corrosion by polysulfides and other electrolyte species, as well as the promotion of smooth deposits without dendrites, makes the Li3N coating highly promising for applications in lithium metal batteries, such as lithium-sulfur batteries. The present findings show that the formation of Li3N can be achieved with lithium electrodes covered by a secondary electrolyte interface layer, which proves that the in situ formation of Li3N coatings inside the batteries is attainable.