The P-T evolution (and particularly the prograde path segment) of ultrahigh-temperature (UHT) granulites is commonly ambiguous, hampering our understanding of deep crustal processes. Here, we establish the P-T path by distinguishing garnet origin (peritectic or retrograde) based on the combined Ca, Ti, Zr, and Y+REE chemical signatures, using the residual UHT granulites of the Khondalite Belt, North China Craton, as a test case. In these rocks, peritectic garnet is characterized by rare inclusions, whereas retrograde garnet has overprinted the main foliation and is characterized by abundant biotite and sillimanite inclusions, which are interpreted to have grown together with retrograde garnet during cooling. Zirconium in peritectic garnet increases from 10 to 50 ppm with garnet growth. In contrast, Zr in retrograde garnet generally decreases from 60 to 10 ppm with garnet growth. A similar trend is observed for Ti. Temperatures calculated from the Ti-in-garnet geothermometer increase from 830 to 980 °C based on Ti in peritectic garnet, indicating prograde partial melting, whereas decrease from 900 to 700 °C based on Ti in retrograde garnet, indicating post-peak cooling. Peritectic and retrograde garnets show distinct Eu/Eu* (0.2–0.5 vs. 0.05–0.2, respectively) and Ca contents (6000–12 000 vs. 4000–6000 ppm, respectively), which generally decrease with progressive garnet crystallization. The pressures calculated from the Ca-in-garnet geobarometer in peritectic and retrograde garnet are 9–11 and 7–9 kbar, respectively. Peritectic garnet shows a bell-shaped Y (80–340 ppm) pattern, whereas retrograde garnet shows an increase in Y content (20–100 ppm) toward rims. Taken together, these results establish a P-T path comprised of an earlier high-pressure peritectic garnet formation during prograde partial melting before the UHT peak and a late abundant retrograde formation during post-peak cooling stage. We conclude that change of Zr and other elements (e.g., Ti, Ca, Y, and Eu/Eu*) can well distinguish different garnet formation events in UHT granulites, which is critical for the P-T path establishment, and further sheds light on the cause of UHT metamorphism and the geodynamic evolution.