Social media is a growing platform for health-related discourse, opinion and experience sharing, including breastfeeding. For instance, nursing mothers share their personal experiences and opinions about breastfeeding on social networks, such as Facebook and Twitter. Unravelling the sentiments behind these experiences will promote adequate knowledge of many challenges, benefits, and factors influencing breastfeeding behaviours. To achieve this, we mine breastfeeding-related tweets and then perform sentiment analysis of the tweets using lexicon-based and machine learning (ML) techniques with the aim of detecting their sentiment polarity (i.e., positive or negative). Specifically, we implement and compare four lexicon-based sentiment classifiers, as well as five ML-based classifiers. Our results show that VADER-EXT (our extended version of VADER) performed best with an overall F1-score of 82.4%, compared to the other lexicon-based classifiers. On the other hand, Support Vector Machine (SVM) outperformed the other four ML-based classifiers with an overall F1-score of 73.7%. The overall best performing classifier is then used in determining the sentiment polarity of tweets. Next, we conduct thematic analysis of both positive and negative tweets to identify the factors influencing breastfeeding behaviours either positively or negatively. Our findings reveal various health-related factors (such as lactational issues, medical issues, and nutritional issues), social factors, psychological factors, and situational factors affecting breastfeeding behaviours negatively. Also, perceived benefits, maternal selfefficacy, social support, and education and training support emerged as the positive factors influencing breastfeeding behaviours. Finally, we reflect on our findings and recommend interventions that address the negative factors to promote positive breastfeeding behaviours.