The magnetoelastic buckling of a soft ferromagnetic elastic cantilever of elliptic crosssection due to a transverse magnetic field is discussed. The magnetic fields referring to the deflected beam are determined analytically by means of Mathieu functions. These fields are used in the derivation of the buckling value for a slender cantilever. It turns out that this value not only depends upon the thickness-to-length ratio of the beam, but also upon the shape of the cross-section. A comparison with results known from the literature is given for two limiting cases, viz. the circular cross-section and the very wide (and thin) one. In the first case complete agreement is observed; for the second case an essential improvement of the usual approach (based upon the assumption of an infinitely wide cross-section) is attained.