Temporo-spatial observation of the leg could provide important information about the general condition of an animal, especially for those such as sheep and other free-ranging farm animals that can be difficult to access. Tri-axial accelerometers are capable of collecting vast amounts of data for locomotion and posture observations; however, interpretation and optimization of these data records remain a challenge. The aim of the present study was to introduce an optimized method for gait (walking, trotting and galloping) and posture (standing and lying) discrimination, using the acceleration values recorded by a tri-axial accelerometer mounted on the hind leg of sheep. The acceleration values recorded on the vertical and horizontal axes, as well as the total acceleration values were categorized. The relative frequencies of the acceleration categories (RFACs) were calculated in 3-s epochs. Reliable RFACs for gait and posture discrimination were identified with discriminant function and canonical analyses. Post hoc predictions for the two axes and total acceleration were conducted, using classification functions and classification scores for each epoch. Mahalanobis distances were used to determine the level of accuracy of the method. The highest discriminatory power for gait discrimination yielded four RFACs on the vertical axis, and five RFACs each on the horizontal axis and total acceleration vector. Classification functions showed the highest accuracy for walking and galloping. The highest total accuracy on the vertical and horizontal axes were 90% and 91%, respectively. Regarding posture discrimination, the vertical axis exhibited the highest discriminatory power, with values of RFAC (0, 1]=99.95% for standing; and RFAC (−1, 0]=99.50% for lying. The horizontal axis showed strong discrimination for the lying side of the animal, as values were in the acceleration category of (0, 1] for lying on the left side and (−1, 0] on the right side. The algorithm developed by the method employed in the present study facilitates differentiation of the various types of gait and posture in animals from fewer data records, and produces the most reliable acceleration values from only one axis within a short time frame. The present study introduces an optimized method by which the tri-axial accelerometer can be used in gait and posture discrimination in sheep as an animal model.