The invertebrate fauna of nontidal portions of the lower San Joaquin River and its major tributaries is described in relation to water quality and habitat using canonical correspondence analysis, autecological metrics, and indicator species analysis. A large-scale (basin-wide) pattern in community response to salinity (sulfate-bicarbonate type) was detected when standardized, stable substratum was sampled. Community structure, taxa richness, and EPT (ephemeropterans, plecopterans, and trichopterans) richness varied with dissolved solids concentration (55-1700 mg total dissolved solids. L-1), and distributions of many taxa indicated salinity optima. Distinct assemblages associated with either high or low salinity were evident over this range. Large-scale patterns in community structure were unrelated to pesticide distributions. Structure and taxa richness of invertebrate assemblages in sand substratum varied both with salinity and with microhabitat heterogeneity. The benthic fauna generally was dominated by a taxa-poor assemblage of specialized psammophilous species, contributing to a weaker relationship between community structure and water quality than was observed using standardized substratum. Habitat types and associated dominant species were characterized using indicator species analysis. Species assemblages did not vary substantially with irrigation regime or fiver discharge, indicating that structure of invertebrate communities was a conservative measure of water quality.