The large prehistoric city of Liangzhu and its associated earthen dike emerged on the Yangtze delta-coast after two millennia of occupation in this area by scattered communities. Details of its development have been widely discussed in the literature. Our results reveal that the city was selectively built at the head of an embayment backed by hills, with close access to food, freshwater and timber, and with protection from coastal hazards. Radiocarbon and optically stimulated luminescence (OSL) dating shows that it was built around 4.8–4.5 ka, and the earthen dike was constructed a little later at ~ 4.1 ka. During this time, saltwater wetlands were changing to freshwater in response to rapid coastal progradation as the postglacial sea-level rise stabilized. This facilitated rice farming and furthered the development of the city with elaborate city planning. The younger large-scale earthen dike and artificial ponds possibly suggest increasing demand for flood mitigation and irrigation.