The bacterial community composition in small streams and a river in central Germany was examined by temperature gradient gel electrophoresis (TGGE) with PCR products of 16S rRNA gene fragments and sequence analysis. Complex TGGE band patterns suggested high levels of diversity of bacterial species in all habitats of these environments. Cluster analyses demonstrated distinct differences among the communities in stream and spring water, sandy sediments, biofilms on stones, degrading leaves, and soil. The differences between stream water and sediment were more significant than those between sites within the same habitat along the stretch from the stream source to the mouth. TGGE data from an entire stream course suggest that, in the upper reach of the stream, a special suspended bacterial community is already established and changes only slightly downstream. The bacterial communities in water and sediment in an acidic headwater with a pH below 5 were highly similar to each other but deviated distinctly from the communities at the other sites. As ascertained by nucleotide sequence analysis, stream water communities were dominated by Betaproteobacteria (one-third of the total bacteria), whereas sediment communities were composed mainly of Betaproteobacteria and members of the Fibrobacteres/Acidobacteria group (each accounting for about 25% of bacteria). Sequences obtained from bacteria from water samples indicated the presence of typical cosmopolitan freshwater organisms. TGGE bands shared between stream and soil samples, as well as sequences found in bacteria from stream samples that were related to those of soil bacteria, demonstrated the occurrence of some species in both stream and soil habitats. Changes in bacterial community composition were correlated with geographic distance along a stream, but in comparisons of different streams and rivers, community composition was correlated only with environmental conditions.