Objective: to identify the levels of anxiety and breastfeeding self-efficacy in puerperal women at the intervals of 60, 120, and 180 days postpartum; and to verify the influence of anxiety on breastfeeding self-efficacy among these puerperal women. Method: an analytical, longitudinal and prospective study, conducted with 186 puerperal women, and which used a sociodemographic and obstetric characterization questionnaire, the State-Trait Anxiety Inventory, and the Breastfeeding Self-Efficacy Scale - Short Form. The analyses were performed by means of descriptive statistics, and Fisher’s Exact Test was used. Results: most of the puerperal women presented low levels of trait anxiety (55.4%) and of state anxiety (66.2% at 60 days, 72.8% at 120 days, and 75.5% at 180 days), and a high level of self-efficacy (77.3% at 60 days, 75.3% at 120 days, and 72.1% at 180 days of puerperium). Low levels of trait anxiety and state anxiety were associated with high self-efficacy at 60 days (p=0.0142 and p=0.0159, respectively). Conclusion: it is necessary to pay greater attention to the mental health of puerperal women, considering that those who presented low levels of anxiety had higher levels of self-efficacy, a situation that can result in longer exclusive breastfeeding.