Euglenoids, a family of aquatic unicellular organisms, present the ability to alter the shape of their bodies, a process referred to as metaboly [1–5]. Metaboly is usually used by phagotrophic cells to engulf their prey. However, Euglena gracilis is osmotrophic and photosynthetic. Though metaboly was discovered centuries ago, it remains unclear why E. gracilis undergo metaboly and what causes them to deform [1–5], and some consider metaboly to be a functionless ancestral vestige [5]. Here, we show that flagellum malfunctions trigger metaboly and metaboly is an escape strategy adopted by E. gracilis when the proper rotation and beating of the flagellum are hindered by restrictions including surface obstruction, sticking, resistance, or limited space. Metaboly facilitates escape in five ways: 1) detaching the body from the surface and decreasing the attaching area attached to the interface, which decreases the adhering force and is advantageous for escaping; 2) enlarging the space between flagellum and the restricting surface which restores beating and rotation of the flagellum; 3) decreasing the torque of viscous resistance for rotation of the body and changing the direction of the body to restore flagellar function; 4) decreasing the length of the body, which pulls the flagellum away from the restrictive situations; and 5) crawling backwards on a surface or swimming backwards in a bulk fluid if the flagellum completely malfunctions or has broken off. Taken together, our findings suggest that metaboly plays a key role in enabling E. gracilis to escape from harmful conditions when flagellar functions is impaired or absent. Our findings can inspire the bionic design of adaptive soft robots and facilitate the control of water blooms of euglena in freshwater aquiculture industry.