The aim of this paper is to find those pairs of generalized quasi-arithmetic means on an open real interval I for which the arithmetic mean is invariant, i.e., to characterize those continuous strictly monotone functions ϕ, ψ : I → R and Borel probability measures μ, ν on the interval [0, 1] such thatholds. Under at most fourth-order differentiability assumptions and certain nondegeneracy conditions on the measures, the main results of this paper show that there are three classes of the solutions ϕ, ψ: they are equivalent either to linear, or to exponential or to power functions.