We examined the association between prolonged breastfeeding and anthropometric status in a population-based cohort study of 5,914 liveborns from the city of Pelotas in Southern Brazil. When children from all socioeconomic groups were studied, there was no important association between current breastfeeding and anthropometric status at age 12 months. Children who were still breastfed at age 20 months--and, to a lesser extent, at 43 months--presented with poorer anthropometric status than their nonbreastfed counterparts. We did not find the same pattern in all socioeconomic groups, however. Children from low-income families who were breastfed tended to present better anthropometric status than those who were not, whereas the reverse was observed for children of middle- and high-income families. After controlling for confounding variables, the nutritional advantage of breastfeeding among low-income families was no longer clear, while the superiority of nonbreastfed infants amongst middle- and high-income children persisted. These findings indicate that some of the controversy regarding the nutritional effects of prolonged breastfeeding may have been caused by confounding and effect modification. Any decisions on whether or not breastfeeding should be encouraged after the first year of life should take into account the characteristics of the population as well as the anti-infective and birth-spacing properties of breastfeeding.