The paper aims to analyse how the different economic phases that Spain has experienced in the first two decades of the 21st century (expansion, recession, and recovery) have influenced population stocks and migratory flows in the five largest metropolitan areas defined as Functional Urban Areas (FUAs) in Spain: Barcelona, Bilbao, Madrid, Seville and Valencia. Using Padrón Continuo (municipal registers) and Estadística de Variaciones Residenciales (residential change statistics) as data sources, both native and immigrant – i.e. born abroad – stocks, and internal and international migration flows are analysed. We study differences between (a) diverse groups of foreigners (by continental origin), also comparing them to natives; and (b) different types of residential mobility by migrants’ previous place of residence: “intrametropolitan” movements (between urban cores and peripheries), migration flows between the five urban areas and the rest of Spain, and international migration.
 Results show that intrametropolitan migration flows between the five urban cores and their peripheries were characterised by suburbanisation during the expansion phase. These flows were particularly relevant for Spanish-born persons and, among foreign-born migrants, for people born in the Americas (mainly Latin Americans). These flows to the suburban periphery decreased during the economic crisis, and in 2013 and 2014 net intrametropolitan migration of most foreign groups was characterised by recentralisation. Spaniards’ intrametropolitan movements almost reached equilibrium during the recession years: Natives decreased their moves from cores to rings, while they were increasingly attracted to urban centres. Owing to the incipient economic recovery, suburbanisation is progressively recovering its previous strength. As for other types of residential moves, foreign-born migrants moving from abroad and the rest of Spain to the five FUAs during the economic expansion phase reversed the direction of their flows in the economic crisis years, migrating abroad or dispersing throughout Spain in search of jobs. Consequently, their stocks declined in some years. Currently, due to the incipient economic recovery, the five FUAs are attracting internal and international foreign-born immigrants once again, so their foreign-born population stocks are increasing in both cores and peripheries. Spaniards show the opposite behaviour regarding flows to and from the five areas analysed – they tended to disperse throughout the rest of Spain during the economic expansion phase. This trend continued during the crisis years, but at a slower pace, as natives became increasingly attracted to urban cores. Furthermore, this latter trend has strengthened during the post-crisis years. Finally, considering foreign-born and Spanish populations together, large urban areas are increasingly attractive. This global tendency is to the detriment of rural areas and of non-metropolitan small and medium size towns, which lose population due to negative net migration.
 * This article belongs to a special issue on “Internal Migration as a Driver of Regional Population Change in Europe: Updating Ravenstein”.