Female mate preferences for male traits and resource characteristics affect trait evolution and diversification. Here, we test the effects of male body traits and territory characteristics on within-population female preferences and on population–assortative mating in the cichlid Tropheus moorii. Within-population preferences of females were independent of male body size, coloration and territory size but were strongly dependent on territory quality and co-varied with male courtship activity. Courtship activity of individual males was contingent on the quality of their assigned territory, and therefore, courtship may not only indicate intrinsic male quality. On the basis of these results we suggest that female preferences for high-quality territories reinforce the outcome of male–male competition and ensure male mating success. Mating preferences of females for males of their own color variant (ascertained in a previous experiment) were not overturned when males of another color variant were presented in a superior territory, indicating that within- and between-population mate preferences of females depend on different cues.