We present a measurement of the spatial clustering of submillimetre galaxies ( SMGs ) at z = 1 –3 . Using data from the 870 \mu m LABOCA submillimetre survey of the Extended Chandra Deep Field South , we employ a novel technique to measure the cross-correlation between SMGs and galaxies , accounting for the full probability distributions for photometric redshifts of the galaxies . From the observed projected two-point cross-correlation function we derive the linear bias and characteristic dark matter halo masses for the SMGs . We detect clustering in the cross-correlation between SMGs and galaxies at the > 4 \sigma level . Accounting for the clustering of galaxies from their autocorrelation function , we estimate an autocorrelation length for SMGs of r _ { 0 } = 7.7 ^ { +1.8 } _ { -2.3 } h ^ { -1 } Mpc assuming a power-law slope \gamma = 1.8 , and derive a corresponding dark matter halo mass of \log ( M _ { halo } [ h ^ { -1 } M _ { \sun } ] ) = 12.8 ^ { +0.3 } _ { -0.5 } . Based on the evolution of dark matter haloes derived from simulations , we show that that the z = 0 descendants of SMGs are typically massive ( \sim 2–3 L ^ { * } ) elliptical galaxies residing in moderate- to high-mass groups ( \log ( M _ { halo } [ h ^ { -1 } M _ { \sun } ] ) = 13.3 ^ { +0.3 } _ { -0.5 } ) . From the observed clustering we estimate an SMG lifetime of \sim 100 Myr , consistent with lifetimes derived from gas consumption times and star-formation timescales , although with considerable uncertainties . The clustering of SMGs at z \sim 2 is consistent with measurements for optically-selected quasi-stellar objects ( QSOs ) , supporting evolutionary scenarios in which powerful starbursts and QSOs occur in the same systems . Given that SMGs reside in haloes of characteristic mass \sim 6 \times 10 ^ { 12 } h ^ { -1 } M _ { \sun } , we demonstrate that the redshift distribution of SMGs can be described remarkably well by the combination of two effects : the cosmological growth of structure and the evolution of the molecular gas fraction in galaxies . We conclude that the powerful starbursts in SMGs likely represent a short-lived but universal phase in massive galaxy evolution , associated with the transition between cold gas-rich , star-forming galaxies and passively evolving systems .