The near-zero thermal expansion of A 2 O(PO 4 ) 2 oxides (A = Th, U, Zr, and Hf) is investigated by first-principles calculations, and the role of structural flexibility, strongly related to transverse vibrations, is clarified. The results of lattice dynamics simulations indicate that the low positive or negative thermal expansion of A 2 O(PO 4 ) 2 mainly originates from the competition between phonon modes with positive and negative Gruneisen parameters in the low-frequency range. This work provides new insights to help the discovery and design of new materials with ultralow or controlled thermal expansion.