Fences are increasingly fragmenting landscapes and curtailing the movement of terrestrial wildlife. In arid and semi-arid ecosystems, where herbivores rely on movement to access patchily distributed resources, fences may cause behavioural changes with consequences for energy balance and fitness. Here, we investigate the fine-scale behavioural responses of the highly mobile springbok antelope (Antidorcas marsupialis) to encounters with a veterinary cordon fence in northern Namibia. Using supervised machine learning on tri-axial accelerometer data from collared individuals, we trained a classifier capable of identifying 12 behavioural categories with up to 91% accuracy. Applying this model to over 29,000 accelerometer records from eight free-ranging springbok, we examined behaviour in relation to fence encounters. We found significant changes in behaviour in response to fences, which depended on whether the fence was successfully crossed or not. Fence crossings were associated with shifts from grazing to browsing during crossings, as well as increased walking during and after crossings, suggesting altered foraging and increased movement. Behavioural changes were less pronounced in the case of non-crossing encounters. Our results show how accelerometry can reveal behavioural responses to anthropogenic barriers and emphasise the importance of maintaining ecological connectivity for migratory ungulates.