To investigate risk factors for dehydrating diarrhoea in infants, with special interest in the weaning period. Case-control study. Metropolitan area of Porto Alegre, Brazil. Cases were 192 children aged 0-23 months hospitalised with acute diarrhoea and moderate to severe dehydration. Controls were 192 children matched for age and neighbourhood who did not have diarrhoea in the previous week. Associations between dehydrating diarrhoea and child's age, type of milk consumed, time since breast feeding stopped, and breast feeding status. In infants aged < 12 months the risk of dehydrating diarrhoea was significantly higher in the first 9 months of life (P < 0.001), and in those aged 12-23 months the risk was again greater in younger children (12-17 months) (P = 0.03). The type of milk consumed before start of diarrhoea episode was strongly associated with dehydration independent of socioeconomic, environmental, maternal reproductive, demographic, and health services factors. Compared with infants exclusively breast fed, bottle fed infants were at higher risk (odds ratio (95% confidence interval) for cow's milk 6.0 (1.8 to 19.8), for formula milk 6.9 (1.4 to 33.3)). Compared with those still breast feeding, children who stopped in the previous two months were more likely to develop dehydrating diarrhoea (odds ratio 8.4 (2.4 to 29.6)). This risk decreased with time since breast feeding stopped. These results confirm the protective effect of breast feeding and suggest there is a vulnerable period soon after breast feeding is stopped, which may be of relevance for developing preventive strategies.