With a general method based on the theory of pseudoanalytic functions, a sequence of exact solutions of the magnetohydrodynamic equilibrium equation of an axisymmetric plasma configuration is found. A particular solution corresponding to reasonable boundary conditions and pressure and current density profiles is analysed in some detail. The Mercier criterion is used to study stability against localized perturbations.