In this paper, we consider a dynamical system related to the Yang–Mills system for a field with gauge group SU(2). We solve this system in terms of genus two hyperelliptic functions. The corresponding invariant surface defined by the two constants of motion can be completed as a cyclic double cover of an abelian surface (the jacobian of a genus 2 curve) and we show that this system is algebraic completely integrable in the generalized sense. Also we show that this system is part of an algebraic completely integrable system in five unknowns having three constants of motion.