The origin of dolomite that hosts the Bayan Obo REE-Nb-Fe deposit (57.4 Mt.@6% REE2O3, 2.16 Mt.@0.13% Nb2O5, and >1500 Mt.@35% iron oxides) has been controversial for decades, but it is integral to understanding of the genesis of this giant deposit. In this study, based on the textures and in situ major and trace element composition of its carbonates, the dolomite was proved to be initially generated from magnesio-ferro‑carbonatite melts. It subsequently experienced magmatic-hydrothermal alteration and recrystallization in a low strain environment, caused by calcio‑carbonatitic fluids, with formation of finer-grained dolomite, interstitial calcite and increasing amounts of associated fluorocarbonates. Available stable isotope analyses indicate that the recrystallized ore-hosting dolomite has higher δ13C and δ18O ratios compared to its igneous coarse-grained precursor. Rayleigh fractionation during the recrystallization process, rather than crustal contamination, played a major role in the highly-variable stable isotope composition of carbonates in the dolomite. Low-T alteration increased variability with apparently random increases in δ18O within carbonates. The REE, Ba and Sr were added simultaneously with the elevated (La/Yb)cn from magnesio-ferro‑carbonatite melts to calcio‑carbonatitic fluids, and to carbonatite-derived aqueous fluids, through which extensive fluorine metasomatism and alkali alteration overlapped the recrystallization of the ore-hosting dolomite. Therefore, the multi-stage REE mineralization at Bayan Obo is closely related to metasomatism by calcio‑carbonatitic fluids of previously-emplaced intrusive magnesio-ferro‑carbonatite bodies during late evolution of the Bayan Obo carbonatite complex. Then, the ore-hosting dolomitic carbonatite was subjected to compressive tectonics during a Paleozoic subduction event, and suffered intense, largely brittle, deformation, which partially obscured the earlier recrystallization process. The complex, multi-stage evolution of the ore-hosting dolomite is responsible for the uniqueness, high grade and giant size of the Bayan Obo deposit, the world's largest single REE resource with million tonnes of REE oxides.