The structure of static MHD equilibria that admit continuous families of Euclidean symmetries is well understood. Such field configurations are governed by the classical Grad-Shafranov equation, which is a single elliptic PDE in two space dimensions. By revealing a hidden symmetry, we show that in fact all nondegenerate solutions of the equilibrium equations satisfy a generalization of the Grad-Shafranov equation. In contrast to solutions of the classical Grad-Shafranov equation, solutions of the generalized equation are not automatically equilibria, but instead only satisfy force balance averaged over the one-parameter hidden symmetry. We then explain how the generalized Grad-Shafranov equation can be used to reformulate the problem of finding exact three-dimensional smooth solutions of the equilibrium equations as finding an optimal volume-preserving symmetry.