This present study investigated the changes in bacterial community composition, with an emphasis on Lactobacillus spp. and Streptococcus suis populations as potentially beneficial and harmful groups, in the stomach, jejunum and ileum of piglets after weaning (21 days postpartum) by 16S rRNA gene-based methods. Denaturing gradient gel electrophoresis analysis showed that, after weaning, predominant bands related to Lactobacillus spp. disappeared and were replaced by potential pathogenic species, such as Peptostreptococcus anaerobius, Moraxella cuniculi, S. suis and Porphyromonas catoniae. Real-time PCR revealed that the abundances of lactobacilli and Lactobacillus sobrius as a proportion of total bacterial abundance were significantly lower in the stomach, jejunum and ileum of weaned piglets than in 21-day-old piglets. A specific and sensitive real-time PCR assay was developed for quantification of the important pathogen S. suis within gastrointestinal microbiota. The assay showed that S. suis predominated in the stomach samples of weaned piglets with population levels up to 10(7) copies g(-1) digesta, while it was not detected in the stomach before weaning. Streptococcus suis was not dominant in the jejunum and ileum digesta before weaning, but became dominant after weaning, with population levels up to 10(7) copies g(-1) digesta. The results demonstrated for the first time the postweaning dominance of the potentially harmful S. suis in piglet intestine. The results also suggest that the defensive barrier of the stomach can be impaired as S. suis became dominant while the proportion of Lactobacillus populations decreased after weaning, which may further result in an increase of S. suis abundance in the intestine.