Muscle function depends in part on the interplay between its activity and its length within the stretch-shortening cycle. The longissimus dorsi is a large epaxial muscle running along the thoracic and lumbar regions of the equine back. Due to its anatomical positioning, the longissimus dorsi has the capability of contributing to many functions: developing bending moments in the dorsoventral and lateral (coupled to axial rotation) directions and also providing stiffness to limit motion in these directions. We hypothesize that the exact function of the longissimus dorsi will vary along the back and between gaits as the relation between activity and motion of the back changes. Electromyograms (EMG) were recorded at walk (inclined and level) and trot (on the level) on a treadmill from the longissimus dorsi at muscle segments T14, T16, T18 and L2. Back motion was additionally measured using a fibre-optic goniometer. Co-contractions of the muscle between its left and right sides were quantified using correlation analysis. A greater dominance of unilateral activity was found at more cranial segments and for level walking, suggesting a greater role of the longissimus dorsi in developing lateral bending moments. Timing of the EMG varied between muscle segments relative to the gait cycle, the locomotor condition tested and the flexion–extension cycle of the back. This supports the hypothesis that the function of the longissimus dorsi changes along the back and between gaits.