We calculate the next-to-next-to-leading-order (NNLO) QCD radiative correction to the pion electromagnetic form factor with large momentum transfer. We explicitly verify the validity of the collinear factorization to two-loop order for this observable and obtain the respective IR-finite two-loop hard-scattering kernel in the closed form. The NNLO QCD correction turns out to be positive and significant. Incorporating this new ingredient of correction, we then make a comprehensive comparison between the finest theoretical predictions and numerous data for both space- and timelike pion form factors. Our phenomenological analysis provides a strong constraint on the second Gegenbauer moment of the pion light-cone distribution amplitude obtained from recent lattice QCD studies. Published by the American Physical Society 2024