Context. Whether the Cygnus X complex consists of one physically connected region of star formation or of multiple independent regions projected close together on the sky has been debated for decades. The main reason for this puzzling scenario is the lack of trustworthy distance measurements. Aims. We aim to understand the structure and dynamics of the star-forming regions toward Cygnus X by accurate distance and proper motion measurements. Methods. To measure trigonometric parallaxes, we observed 6.7 GHz methanol and 22 GHz water masers with the European VLBI Network and the Very Long Baseline Array. Results. We measured the trigonometric parallaxes and proper motions of five massive star-forming regions toward the Cygnus X complex and report the following distances within a 10% accuracy: 1.30 +0.07 −0.07 kpc for W 75N, 1.46 +0.09 −0.08 kpc for DR 20, 1.50 +0.08 −0.07 kpc for DR 21, 1.36 +0.12 −0.11 kpc for IRAS 20290+4052, and 3.33 +0.11 −0.11 kpc for AFGL 2591. While the distances of W 75N, DR 20, DR 21, and IRAS 20290+4052 are consistent with a single distance of 1.40 ± 0.08 kpc for the Cygnus X complex, AFGL 2591 is located at a much greater distance than previously assumed. The space velocities of the four star-forming regions in the Cygnus X complex do not suggest an expanding Strömgren sphere.