In this paper, we study differential infant and child mortality according to the origin of the mothers, natives of Madrid or immigrants, between 1916 and 1926. From 1880 to 1939, Madrid experienced spectacular demographic growth, with a massive influx of immigrants, mainly from the Castilian Plateau. Using the city’s records of births and deaths, which we linked for the study period, we demonstrate an important spatial heterogeneity in infant and child mortality across the city. Although the development of the town was planned in the 1860s, the infrastructure and the real estate market were overwhelmed by the continuous arrival of new inhabitants. Moreover, major investments in public health increased the gap between the wealthy districts and peripheral areas. These improvements deepened inequality. During years marked by the waves of the influenza pandemic, we isolate the impact of poverty, which threatened the survival of newborns through poor nutrition, deficient hygienic infrastructures and deplorable housing conditions. Such features explain the impressive association between summer and the risk of dying from enteritis, diarrhea and other diseases of the same type among weaned children. However, the mortality differentials between the offspring of native and migrant mothers were surprisingly small, which we explained in terms of behavioral adaptation to the large city and its mass society.