We show that there is a model of ZF in which the Borel hierarchy on the reals has length ω2. This implies that ω1 has countable cofinality, so the axiom of choice fails very badly in our model. A similar argument produces models of ZF in which the Borel hierarchy has exactly λ + 1 levels for any given limit ordinal λ less than ω2. We also show that assuming a large cardinal hypothesis there are models of ZF in which the Borel hierarchy is arbitrarily long.