Inorganic semiconductor materials are crucial for modern technologies, but their brittleness and limited processability hinder the development of flexible, wearable, and miniaturized electronics. The recent discovery of room-temperature plasticity in some inorganic semiconductors offers a promising solution, but the deformation mechanisms remain controversial. Here, we investigate the deformation of indium selenide, a two-dimensional van der Waals semiconductor with substantial plasticity. By developing a machine-learned deep potential, we perform atomistic simulations that capture the deformation features of hexagonal indium selenide upon out-of-plane compression. Unexpectedly, we find that indium selenide plastifies through a martensitic transformation; that is, the layered hexagonal structure is converted to a tetragonal lattice with specific orientation relationship. This observation is corroborated by high-resolution experimental observations and theory. It suggests a change of paradigm, where the design of new plastically deformable inorganic semiconductors can focus on compositions and structures that facilitate phase transformations, going beyond the conventional dislocation slip.