  An accidental U(1) Peccei-Quinn (PQ) symmetry automatically arises in a class
of SO(10) unified theories upon gauging the SU(3)$_{f}$ flavour group. The PQ
symmetry is protected by the $\mathbb{Z}_4 \times \mathbb{Z}_3$ center of
$\text{SO(10)} \times \text{SU(3)}_f$ up to effective operators of canonical
dimension six. However, high-scale contributions to the axion potential posing
a PQ quality problem arise only at $d=9$. In the pre-inflationary PQ breaking
scenario the axion mass window is predicted to be $m_a \in [7 \times 10^{-8},
10^{-3}]$ eV, where the lower end is bounded by the seesaw scale and the upper
end by iso-curvature fluctuations. A high-quality axion, that is immune to the
PQ quality problem, is obtained for $m_a \gtrsim 0.02$ eV. We finally offer a
general perspective on the PQ quality problem in grand unified theories.
