The strong desire for a clean and secure energy future has stimulated great interest in searching for low-cost, highly efficient electrocatalysts for regenerative fuel cells and rechargeable metal-air batteries. Oxygen reduction reaction (ORR) and oxygen evolution reaction (OER) play a paramount role in the operation of these devices, but are notoriously sluggish even with precious metals-based catalysts. Here we report our findings in the development of a bifunctional catalyst based on phosphorus-doped LaFeO3-δ for ORR and OER in alkaline solutions. The remarkable electrocatalytic performance is attributed to larger amount of O2 2−/O− species, trace amount of Fe4+ species, and optimized eg electron filling (≈ 1), benefiting from the doping effect of phosphorus. Both the mass activity and the specific activity are nearly doubled after P-doping. Density functional theory calculations also confirm that the increase in valence state of Fe ions is due mainly to phosphorus doping. These results demonstrate that non-metal element doping is an effective approach to optimizing the electronic configuration, changing valence states of ions, and thus enhancing activities of perovskite electrocatalysts.