The QCD axion is investigated within the minimal supersymmetric SO(10) grand unified theory, where the Yukawa sector involves Higgs multiplets 10 and \( \overline{\textbf{126}} \) . The relative phase between the VEVs of (10, 1, 3) ⊂ \( \overline{\textbf{126}} \) and ( \( \overline{\textbf{10}} \) , 1, 3) ⊂ 126 under SU(4)C × SU(2)L × SU(2)R is identified with the axion. The axion is dominantly the relative phase between ∆R and \( {\overline{\Delta }}_R \) , with a small 10-Higgs component due to the VEV hierarchy. The Peccei-Quinn and B − L symmetry breaking scales coincide through \( \left|\left\langle {\Delta}_R\right\rangle \right|=\left|\left\langle {\overline{\Delta}}_R\right\rangle \right| \) . The scalar partner of the lightest right-handed neutrino plays the role of the inflaton, realizing hybrid inflation consistent with the observed CMB density fluctuations. After inflation, both fields acquire VEVs, and the domain-wall problem is resolved through the Lazarides-Shafi mechanism, which naturally restricts the model to three generations.