Cardiac imaging in small animals is a valuable tool in basic biological research and drug discovery for cardiovascular disease. Multispectral optoacoustic tomography (MSOT) represents an emerging imaging modality capable of visualizing specific tissue chromophores at high resolution and deep in tissues in vivo by separating their spectral signatures. Whereas single-wavelength images can be acquired by multielement ultrasound detection in real-time imaging, using multiple wavelengths at separate times can lead to image blurring due to motion during acquisition. Therefore, MSOT imaging of the heart results in degraded resolution because of the heartbeat. In this work, we applied a clustering algorithm, k-means, to automatically separate a sequence of single-pulse images at multiple excitation wavelengths into clusters corresponding to different stages of the cardiac cycle. We then performed spectral unmixing on each cluster to obtain images of tissue intrinsic chromophores at different cardiac stages, showing reduced sensitivity to motion compared to signal averaging without clustering. We found that myocardium images of improved resolution and contrast can be achieved using MSOT motion clustering correction. The correction method presented could be generally applied to other MSOT imaging applications prone to motion artifacts, for example, by respiration and heartbeat.