The purpose of this study was to assess the duration of breastfeeding and the sociodemographic factors affecting it. Data for the study were drawn from the Bangladesh Demographic and Health Survey 2004. In total 5,364 mothers were included in the study. The life table and Cox's proportional hazards model were employed for the analysis of breastfeeding-related data, which showed that the average duration of breastfeeding was 31.9 months. Cox regression analysis revealed that the duration of breastfeeding was positively associated with maternal age, contraceptive-use, work status, and religion and was negatively associated with age at marriage, parity, delivery status, region, and maternal education. Younger mothers, having higher education, higher maternal parity, caesarean-section birth, being a Muslim, and mothers who have not used any contraceptive were associated with lower duration of breastfeeding. The findings suggest that health institutions can play a significant role in promoting breastfeeding in Bangladesh. Educational campaigns that stress the benefits of lactation are important strategies for encouraging mothers to breastfeed longer