Nb-Y-F mineralized pegmatites (NYF-type) represent critical sources of rare earth element (REE), although the mechanisms of REE enrichment during magmatic-hydrothermal evolution remain poorly constrained. We investigate the Shanghu NYF-type pegmatites (Xinjiang, China) through
in situ geochemistry and U-Pb dating of accessory minerals to resolve these processes. The REE minerals identified in Shanghu pegmatite include monazite, chevkinite, allanite and apatite. Monazite represents the earliest crystallized REE-rich phase, with an average REE content of 69.7 wt%. Some monazite grains exhibit reaction features with hydrothermal fluids, resulting in coronas textures consisting of secondary allanite (III), apatite (Ap II), and thorite. The second REE rich mineral is chevkinite, containing an average of 47.0 wt% REE; it is usually enveloped by allanite and is rarely affected by hydrothermal fluids. Allanite is the predominant REE-hosting mineral, mainly crystallizing during the magmatic stage (Aln I), with an average REE content of 26.2 wt%. A later generation of allanite (Aln II) has undergone metasomatic alteration by hydrothermal fluids. The widespread occurrence of primary REE-rich minerals suggests that the parent magma was initially enriched in rare earth elements. Based on the compositional differences between primary and secondary monazite and allanite, we infer that the hydrothermal fluid was enriched in Ca-Al-Na-K and characterized by high oxidation fugacity. Zircon U-Pb dating yields a crystallization age of 1825 ± 4 Ma for the Shanghu pegmatites, coeval with the assembly of the Columbia supercontinent and likely driven by deep crustal melting. The εNd(t) values of magmatic allanite, chevkinite, and monazite range from -8.2 to -6.6, which are consistent with the ancient crustal signatures of the Tarim basement (-14.8 to -5.5) and the Qingir granitic gneiss (-7.0 to -5.5) but distinct from the surrounding rocks (+3.1 to +3.3). Hydrothermal allanite exhibits εNd(t) values (-9.4 to -6.1) comparable to its magmatic counterpart, suggesting limited external input of Nd (and other REEs) from late-stage hydrothermal fluids. We conclude that REE mineralization within NYF-type pegmatite systems is governed by three primary factors: (1) the availability of geochemically fertile crustal protoliths, (2) extensive magmatic evolution, and (3) late-stage, fluid-mediated element redistribution.