We analyse the anisotropic clustering of massive galaxies from the Sloan Digital Sky Survey III Baryon Oscillation Spectroscopic Survey (BOSS) Data Release 9 (DR9) sample, which consists of 264 283 galaxies in the redshift range 0.43 < z < 0.7 spanning 3275 deg2. Both peculiar velocities and errors in the assumed redshift–distance relation (‘Alcock–Paczynski effect’) generate correlations between clustering amplitude and orientation with respect to the line of sight. Together with the sharp baryon acoustic oscillation (BAO) standard ruler, our measurements of the broad-band shape of the monopole and quadrupole correlation functions simultaneously constrain the comoving angular diameter distance (2190 ± 61 Mpc) to z = 0.57, the Hubble expansion rate at z = 0.57 (92.4 ± 4.5 km s−1 Mpc−1) and the growth rate of structure at that same redshift (dσ8/d ln a = 0.43 ± 0.069). Our analysis provides the best current direct determination of both DA and H in galaxy clustering data using this technique. If we further assume a Λcold dark matter expansion history, our growth constraint tightens to dσ8/d ln a = 0.415 ± 0.034. In combination with the cosmic microwave background, our measurements of DA, H and dσ8/d ln a all separately require dark energy at z > 0.57, and when combined imply ΩΛ = 0.74 ± 0.016, independent of the Universe's evolution at z < 0.57. All of these constraints assume scale-independent linear growth, and assume general relativity to compute both (10 per cent) non-linear model corrections and our errors. In our companion paper, Samushia et al., we explore further cosmological implications of these observations.