Spaces with a Weyl-type connection and torsion of a special type that are determined by the structure of the differentiability conditions in the algebra of complex quaternions are considered. These conditions are consistent only if the curvature of the connection is self-dual. The Maxwell and SL(2,ℂ) Yang–Mills fields associated with the irreducible components of the connection also turn out to be self-dual, so that the corresponding equations are fulfilled on the solutions of the generating system. Using the twistor structure of the latter, its general solution is obtained. The singular locus has a string-like (particle-like) structure generating the self-consistent algebraic dynamics of the string system. © 2018, Pleiades Publishing, Ltd.