Under the cap‐cyclide coordinate system, the marginal stability of a sharp boundary toroidal plasma whose cross section is D shaped is examined using the energy principle. The analytical results are valid for arbitrary &bgr;, arbitrary aspect ratio, and arbitrary elongation of the plasma. There exists a maximum elongation for a given aspect ratio. The critical beta &bgr;cis computed for several aspect ratios and elongations. For given aspect ratio, &bgr;cincreases as long as the elongation increases.