Most economic activity occurs in cities. This creates a tension between local increasing returns, implied by the existence of cities, and aggregate constant returns, implied by balanced growth. To address this tension, we develop a theory of economic growth in an urban environment. We show how the urban structure is the margin that eliminates local increasing returns to yield constant returns to scale in the aggregate, thereby implying a city size distribution that is well described by a power distribution with coefficient one: Zipf’s Law. Under strong assumptions our theory produces Zipf’s Law exactly. More generally, it produces the systematic deviations from Zipf’s Law observed in the data, namely, the underrepresentation of small cities and the absence of very large ones. In these cases, the model identifies the standard deviation of industry productivity shocks as the key element determining dispersion in the city size distribution. We present evidence that the dispersion of city sizes is consistent with the dispersion of productivity shocks in the data.