The Carboniferous post-orogenic Huaco and Sanagasta granites are located in the central sector of the Velasco Range, northwestern Argentina, and host rare-element (Be) pegmatites. They are highly fractionated peraluminous granites with porphyritic textures having variable sizes and abundances of K-feldspar megacrysts. Two different types of parental granites are recognized: a Regional Porphyritic Granite (RPG), distant from the Be-pegmatites, and an Adjacent Porphyritic Granite (APG) surrounding the Be-pegmatites. At the pegmatite margins, aplites (MA), or more rarely equigranular leucogranites, are in contact with the APG. The granite-to-pegmatite transition is characterized by a decreasing biotite/muscovite ratio and TiO 2 -Fe 2 O 3 t -MgO contents, which is consistent with fractional crystallization of biotite, and also by decreasing megacryst and grain size. A continuous magmatic crystallization trend from the RPG to the APG is observed, whereas the MA constitutes the earliest stage of pegmatite formation, characterized by depletion in ferromagnesian elements, calcium and some trace elements (Ba, Sr, Y, Nb, Ce, Zr, Th). However, the granite-pegmatite evolution occurred by differentiation from a common magma source.