City-scale individual movements, resulting population flows, and urban morphology intricately intertwine, collectively contributing to the complexity of urban mobility, impacting critical aspects of a city, including socioeconomic exchanges and epidemic transmission. Existing models, derived from the fundamental laws governing human mobility, often capture only partial facets of this complexity. This paper introduces DeepMobility, a powerful deep generative collaboration network to bridge the heterogeneous behaviors of individuals and collective behaviors emerging from the entire population via constructing a unified model that encapsulates the multifaceted nature of complex urban mobility. Our experiments, conducted on mobility trajectories and flows in cities of China and Senegal, reveal that, in contrast to state-of-the-art deep learning models that simply “memorize” observed data, DeepMobility excels in learning the intricate data distribution and successfully reproduces the existing universal scaling laws that characterize human mobility behaviors at both the individual and population levels. DeepMobility also exhibits robust generalization capabilities, enabling it to generate realistic trajectories and flows for cities lacking corresponding training data. Our approach underscores the feasibility of employing generative deep learning to model the underlying mechanism of human mobility, and establishes an effective generative machine learning framework to capture the complexity of urban mobility comprehensively.