For a surface current model of axisymmetric equilibria with constant plasma pressure, the energy principle is used to perform a combined stability analysis of axisymmetric and nonaxisymmetric MHD modes in the absence of wall stabilization. An improper treatment of the n ≠ 0 modes at low aspect ratio A found in the literature is pointed out and corrected. In the regime 3.8 ⪅ A < ∞, for fixed values of the aspect ratio and β poloidal, β is maximized by optimizing the plasma shape, while the requirements of full MHD stability are observed. In the regime A ⪅ 3.8 no maximum of β is found by shape optimization, and therefore a special selection of typical shapes is considered; specifically, the stability of configurations with circular, elliptical, doublet- and D-shapes is studied. For circular and D-shapes, critical β-values are calculated down to the extreme case of A almost equal to one. In addition, surface-current-model (SCM) spheromaks are considered, which turn out to be MHD-unstable when there is no wall stabilization, the type of situation to which this paper is restricted.