The Koktokay No.3 pegmatite dyke (KPD), containing numerous Li–Be–Nb–Ta–Cs mineral resources, is among the world’s most famous rare-metal deposits, and attracted much attention. Up to now, over thirty geochronological data have been reported ranging from 332 Ma to 120 Ma for the KPD, which causes uncertainty about the origin and petrogenesis of the pegmatite. In this contribution, whole-rock geochemistry and zircon geochronology have been conducted on the Aral biotite monzogranite (BMG), the Koktokay muscovite alkali-feldspar granite (MAG), and the KPD. Petrological and whole-rock geochemistry results reveal that the BMG is normal granite with medium SiO2 (mean of 67.23 %), enriched in compatible trace elements such as Ba, Sr and Zr, and slight negative Eu anomalies, while the MAG belongs to highly-fractionated granite with high SiO2 (mean of 73.92 %) and extensive negative Eu anomalies, and enriched in incompatible trace elements such as Rb, Ta, and U. Zircon morphology and LA–ICPMS analysis reveal that magmatic zircons from the BMG, hydrothermal zircons from the MAG and KPD yield lower intercept ages at 217.3 ± 2.4 Ma, 197.8 ± 4.7 Ma, and 195.4 ± 2.0 Ma, respectively. Combining with tectonic information and geochronological data of granitic activity and its mineralization in the Altay, this study explains the petrogenetic mechanism of the KPD after Wang et al. (2021)‘s metallogenic model: (1) In late stage of Middle Triassic, the collision between the Siberian plate and the Kazakhstan–Junggar plate caused a large number of thrust nappe faults and crust thickening in the Altay orogenic belt; At ∼217 Ma, the compression reached its peak, the crustal anatexis produced syn-collisional BMG (i.e., the Aral BMG); After the compressive peak, huge amount of granitic magma in deep-seated magma chamber underwent over 20 Myr of fractional crystallization, and the residual magma enriched in ore-forming materials (rare metal elements, volatile components, and aqueous fluids) occurred at the top of the magma chamber; (2) When the regional stress converted from compression to extension, the highly-fractionated residual magma ascended rapidly from the long-lived magma chamber along extensional faults at ∼195 Ma; The huge amount of melt-bearing fluids were exsolved from the residual magma in the course of its emplacement due to sharply decreasing pressure, and intruded into a large cavity generated by extensional fault; Along with slowly decreasing temperature, the melt-enriched fluids crystallized outside-in as (quasi-) concentric pegmatitic zones (i.e., KPD); (3) The residual magma which lost huge amount of fluid filled the lower space of the extensional system, and crystallized as post-collisional MAG (i.e., the Koktokay MAG). Based on the genetic relationship among tectonics, petrogenesis, and metallogeny, the proposed model shows material and energetic conversion processes from syn-collisional granites to post-collisional granites with granitic–pegmatitic deposits