We investigate the effects of oxygen vacancies on the ferroelectric behavior of Al:HfO2 films annealed in O2 and N2 atmosphere. X-ray photoelectron spectroscopy results showed that the O/Hf atomic ratio was 1.88 for N2-annealed samples and 1.96 for O2-annealed samples, implying a neutralization of oxygen vacancies during O2 atmosphere annealing. The O2-annealed films exhibited an increasing remanent polarization from 23 μC cm−2 to 28 μC cm−2 after 104 cycles, with a negligible leakage current density of ∼2 μA cm−2, while the remanent polarization decreased from 29 μC cm−2 to 20 μC cm−2 after cycling in the N2-annealed films, with its severe leakage current density decreasing from ∼1200 μA cm−2 to ∼300 μA cm−2. A phase transition from the metastable tetragonal (t) phase to the low-temperature stable orthorhombic (o) phase and monoclinic (m) phase was observed during annealing. As a result of the fierce· competition between the t-to-o transition and the t-to-m transition, clear grain boundaries of several ruleless atomic layers were formed in the N2-annealed samples. On the other hand, the transition from the t-phase to the low-temperature stable phase was found to be hindered by the neutralization of oxygen vacancies, with almost continuous grain boundaries observed. The results elucidate the phase transformation caused by oxygen vacancies in the Al:HfO2 films, which may be helpful for the preparation of HfO2-based films with excellent ferroelectricity.