How do cities grow in the process of structural transformation? To answer this question, 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 low productivity and high subsistence needs, farmland is expensive, households cannot afford large homes and cities are very dense. Increasing productivity reallocates factors away from agriculture, freeing up land for urban expansion and limiting the increase in land values despite higher income and urban population. With the area of cities growing faster than urban population, urban density can persistently decline, as in the data over a long period. The quantitative evaluation calibrated to historical data assembled for France over 180 years explains a large fraction of the joint evolution of urban areas, population density and land values across time and space.