We studied structural, electronic and magnetic properties of a cubic perovskite BaFeO 3−δ (0 ≤ δ ≤ 0.5) within the density functional theory using a generalized gradient approximation and a GGA+U method. According to our calculations, BaFeO3 in its stoichiometric cubic structure should be half-metallic and strongly ferromagnetic, with extremely high Curie temperature (TC ) of 700 -900 K. However, a such estimate of TC disagrees with all available experiments, which report that TC of the BaFeO3 and undoped BaFeO 3−δ films varies between 111 K and 235 K or, alternatively, that no ferromagnetic order was detected there. Fitting the calculated x-ray magnetic circular dichroism spectra to the experimental features seen for BaFeO3, we concluded that the presence of oxygen vacancies in our model enables a good agreement. Thus, the relatively low TC measured in BaFeO3 can be explained by oxygen vacancies intrinsically presented in the material. Since iron species near the O vacancy change their oxidation state from 4+ to 3+, the interaction between Fe 4+ and Fe 3+ , which is antiferromagnetic, weakens the effective magnetic interaction in the system, which is predominantly ferromagnetic. With increasing δ in BaFeO 3−δ , its TC decreases down to the critical value when the magnetic order becomes antiferromagnetic. Our calculations of the electronic structure of BaFeO 3−δ illustrate how the ferromagnetism originates and also how one can keep this cubic perovskite robustly ferromagnetic far above the room temperature.