For heteroepitaxial growth of InAs islands on GaAs͑001͒, a transition of shapes is observed experimentally by scanning-tunneling microscopy and analyzed theoretically in terms of the thermodynamic stability of the islands. The experiments show the coexistence of small islands bound predominantly by shallow facets of the ͕137͖ family and large islands that show a variety of steeper facets, among them the ͕101͖, ͕111͖, and ͕111͖ orientations. The calculations of island stability employ a hybrid approach, where the elastic strain relief in the islands is calculated by continuum elasticity theory, while surface energies and surface stresses are taken from density-functional theory calculations that take into account the atomic structure of the various side facets, as well as of the InAs wetting layer on GaAs͑001͒. With the help of the theoretical analysis, we interpret the observed coexistence of shapes in terms of a structural phase transition accompanied by a discontinuous change of the chemical potential in the islands. Consequences of this finding are discussed in analogy with a similar behavior of GeSi islands on silicon observed previously.