A class of simple climate models including those of the Budyko-Sellers type are formulated from a variational principle. A functional is constructed for the zonally averaged mean annual temperature field such that extrema of the functional occur when the climate satisfies the usual energy-balance equation. Local minima of the functional correspond to stable solutions while saddle points correspond to unstable solutions. The technique can be used to construct approximate solutions from trial functions and to carry out finite-amplitude stability analyses. A spectral example is given in explicit detail.