We show that if G is a second countable locally compact Hausdorff étale groupoid carrying a suitable cocycle c: G → ℤ, then the reduced C∗-algebra of G can be realised naturally as the Cuntz-Pimsner algebra of a correspondence over the reduced C∗-algebra of the kernel G0 of c. If the full and reduced C∗-algebras of G0 coincide, we deduce that the full and reduced C∗-algebras of G coincide. We obtain a six-term exact sequence describing the K-theory of Cr ∗(G) in terms of that of Cr ∗(G0).