The structure of summer fish assemblages was examined along longitudinal gradients in 31 Mediterranean-type rivers of the middle Guadiana basin (south-west Iberian Peninsula), using data from 157 sites including small streams to deep rivers. An ordination analysis, based on 16 variables, was applied to species presence, using principal component and canonical correspondence analysis. The results for the habitat data were compared with those for the biological data using a Mantel analysis, and the agreement was highly significant. Spatial structure was considered by partitioning the total variability among the environmental and geographical variables. The fish assemblages showed longitudinal zoning during the summer, with species distributed over gradients of habitat size (depth), water quality (current and physico-chemical variables), and cover (substratum and vegetation), according to their adult size and life history. The size of the habitat that remained available in summer had the greatest biological effect, being the most important factor explaining fish species distribution and assemblage structure during this stressing season. Strictly spatial variation was low, but there was still a high residual variation. Habitat associations and life-history strategies are discussed for native and exotic species.