Mg-doped perovskite oxides LaNi1−x Mg x O3 (x = 0, 0.08, 0.15) electrocatalysts are synthesized by a sol–gel method using citric acid as complex agent and ethylene glycol as thickening agent. The intrinsic oxygen reduction reaction (ORR) and oxygen evolution reaction (OER) activity of as-prepared perovskite oxides in aqueous electrolyte are examined on a rotating disk electrode (RDE) set up. Li–air primary batteries on the basis of Mg-doped perovskite oxides LaNi1−x Mg x O3 (x = 0, 0.08, 0.15) and nonaqueous electrolyte are also fabricated and tested. In terms of the ORR current densities and OER current densities, the performance is enhanced in the order of LaNiO3, LaNi0.92Mg0.08O3 and LaNi0.85Mg0.15O3. Most notably, partially substituting nickel with magnesium suppresses formation of Ni2+ and ensures high concentration of both OER and ORR reaction energy favorable Ni3+ (e g = 1) on the surface of perovskite catalysts. Nonaqueous Li–air primary battery using LaNi0.92Mg0.08O3 and LaNi0.85Mg0.15O3 as the cathode catalysts exhibit improved performances compared with LaNiO3 catalyst, which are consistent with the ORR current densities.