Monitoring behavioural changes could provide insight into the reproduction status, health, and overall well-being of dairy cows. Traditional methods based on direct observation of the herd, either live or from video recordings, are becoming increasingly labour-intensive and time-consuming as herd size increases. Thus, automatic behaviour recognition systems using accelerometers in combination with machine learning algorithms become more important to continuously and accurately quantify cows’ behaviours. The aim of this study is to propose methods for classifying three behaviours (lying, standing, and feeding) of dairy cows in free-stall barn using leg-mounted accelerometers. Lying, standing, and feeding behaviours of 16 lactating dairy cows were logged for 6 hours with 3D-accelerometers attached to the right hind leg of the cows. The behaviours were simultaneously recorded using visual observation (live and backed-up video-recordings) as reference. Different features were extracted from the logged raw data and classification algorithms (K-nearest neighbours, naïve Bayes, and support vector machine) were used to classify the cows’ behaviours. The models allow excellent classification of the lying behaviour (precision 99%, sensitivity 98%), followed by feeding (precision 82%, sensitivity 86%). Standing was the most difficult behaviour to classify with a maximum precision and sensitivity of 69% and 76%, respectively. These results suggest that leg-mounted accelerometers are promising tools to automatically monitor cows’ behaviours (e.g., feeding time, lying time, lying bouts). Such information could help farmers/veterinarians to make management/treatment decisions and offer new potential technologies for the automated detection of health and welfare problems in dairy cows.