We develop a multi-sector spatial equilibrium model with endogenous land use: land is used either for agriculture or housing. Urban land, densely populated due to commuting frictions, expands out of agricultural land. With rising productivity, the reallocation of workers away from agriculture frees up land for cities to expand, limiting the increase in land values despite higher income and increasing urban population. Due to the reallocation of land use, the area of cities expands at a fast rate and urban density persistently declines, as in the data over a long period. As structural change slows down, cities sprawl less and land values start increasing at a faster rate, as in the last decades. Quantitative predictions of the joint evolution of density and land values across time and space are confronted with historical data assembled for France over 180 years.