The Peccei–Quinn (PQ) solution to the strong CP problem requires an anomalous global U(1) symmetry, the PQ symmetry. The origin of such a convenient global symmetry is quite puzzling from the theoretical point of view in many aspects. In this paper, we propose a simple prescription which provides an origin of the PQ symmetry. There, the global U(1) PQ symmetry is virtually embedded in a gauged U(1) PQ symmetry. Due to its simplicity, this mechanism can be implemented in many conventional models with the PQ symmetry.