Throughout the imperial era, defensive walls surrounded Chinese cities. Although most city walls have vanished, the cities have survived. We analyze a sample of nearly 300 prefectural-level cities in China, among which about half historically had city walls. We document that cities that had walls in late imperial China have higher population and employment density today, despite the fact that their walls have long gone. Using data from various sources, we test several possible explanations of this fact, including (1) walled cities have a well-defined historical core that helps hold economic activity close to the city center today; (2) walled cities today tend to have different industry compositions that are less conducive to decentralization; (3) walled cities are situated in regions where the local geographies make it less desirable to build out; (4) walled cities have more compact shapes that facilitate high density development; and (5) walled cities are located in regions where rural land is more valuable today and discourages urban sprawl. We find that historically walled cities still have higher density after taking into account all of these factors, which we interpret as evidence of economic persistence.