The Permian Huangshanxi Cu–Ni deposit is the second largest magmatic sulfide deposit discovered to date in a major Ni–Cu province related to protracted basaltic magmatism in eastern Xinjiang, China. It is hosted by a small mafic–ultramafic intrusion comprised predominantly of lherzolites, olivine websterites, gabbronorites, and gabbros. The Huangshanxi intrusion is coeval with Permian basalts of tholeiitic and alkaline affinities in the Tuha and Tarim basins, respectively. To evaluate a possible genetic relationship between the Huangshanxi intrusion and a specific type of coeval basalt in the region, as well as ore genesis in the intrusion, we have carried out an integrated mineralogical, petrological, and geochemical study. Our data reveal that the Huangshanxi intrusive rocks are characterized by relatively flat chondrite-normalized REE patterns, depletion in Nb and Ta, and elevated eNd values varying between 6 and 10. These features are similar to those of coeval tholeiitic basalts in the nearby Tuha basin, but are significantly different from those of coeval alkaline basalts in the relatively remote Tarim basin. The geochemical similarities and differences suggest that the Huangshanxi intrusion is genetically related to the tholeiitic basalts in the Tuha basin, not to the alkaline basalts in the Tarim basin, as suggested previously by some researchers. This implies that regional exploration for the Huangshanxi-type Cu–Ni deposits should be centered in the Tuha basin instead of the Tarim basin. More specifically, the uplifted areas around the Tuha basin where similar intrusions may have been brought close to the surface should be carefully examined for mineralization potential. Intrusive relations and mass balance constraints from incompatible trace elements and sulfide abundances suggest that the Huangshanxi intrusion represents a dynamic magma conduit through which multiple pulses of magma ascended to higher levels or to the surface. Numerical simulation of magma evolution and mixing calculations using Sr–Nd isotopes indicate that selective assimilation of S-bearing crustal materials is important for sulfide saturation during the early stages of magma evolution when lherzolites formed. Fractional crystallization may have also played a role in the attainment of sulfide saturation during the later stages of magma evolution when olivine websterites and gabbronorites formed. In both cases, immiscible sulfide droplets were retained in the conduit to form disseminated sulfide lenses while the fractionated silicate liquids and buoyant phases such as plagioclase continued to ascend. Extremely low PGE tenors in the sulfide ores of the Huangshanxi deposit suggest that the parental magma was highly depleted in chalcophile elements possibly due to previous sulfide segregation at depth.