A non-abelian generalisation of a theory of gravity coupled to a 2-form gauge field and a dilaton is found, in which the metric and 3-form field strength are Lie algebra-valued. In the abelian limit, the curvature with torsion is self-dual in four dimensions, or has SU(n) holonomy in 2n dimensions. The coupling to self-dual Yang-Mills fields in 4 dimensions, or their higher dimensional generalisation, is discussed. The abelian theory is the effective action for (2,1) strings, and the non-abelian generalisation is relevant to the study of coincident branes in the (2,1) string approach to M-theory. The theory is local when expressed in terms of a vector prepotential.