I study how trade affects urbanization and real income. To this end, I exploit large-scale exogenous changes in trade stemming from the redrawing of Hungary’s borders after the First World War. I show that urbanization in counties near the new border decreased significantly relative to counties farther away. I rationalize this reduced-form finding in a spatial model in which benefits from trading drive agglomeration around locations where trading activity takes place. Structurally estimating the model, I find a 15.55 percent decrease in Hungarian residents’ average real income after the redrawing of borders, with the largest losses concentrated in border regions.