Autophagy regulates cell survival (or cell death in several cases), whereas apoptosis regulates cell death. However, the relationship between autophagy and apoptosis and the regulative mechanism is unclear. We report that steroid hormone 20-hydroxyecdysone (20E) promotes switching from autophagy to apoptosis by increasing intracellular calcium levels in the midgut of the lepidopteran insect Helicoverpa armigera. Autophagy and apoptosis sequentially occurred during midgut programmed cell death under 20E regulation, in which lower concentrations of 20E induced microtubule-associated protein 1 light chain 3–phosphatidylethanolamine (LC3–II, also known as autophagy-related gene 8, ATG8) expression and autophagy. High concentrations of 20E induced cleavage of ATG5 to NtATG5 and pro-caspase-3 to active caspase-3, which led to a switch from autophagy to apoptosis. Blocking autophagy by knockdown of ATG5, ATG7, or ATG12, or with the autophagy inhibitor 3-methyladenine, inhibited 20E-induced autophagy and apoptosis. Blocking apoptosis by using the apoptosis inhibitor Ac-DEVD-CHO did not prevent 20E-induced autophagy, suggesting that apoptosis relies on autophagy. ATG5 knockdown resulted in abnormal pupation and delayed pupation time. High concentrations of 20E induced high levels of intracellular Ca2+, NtATG5, and active caspase-3, which mediated the switch from autophagy to apoptosis. Blocking 20E-mediated increase of cellular Ca2+ caused a decrease of NtATG5 and active caspase-3 and repressed the transformation from autophagy to apoptosis, thereby promoting cell survival. 20E induces an increase in the concentration of intracellular Ca2+, thereby switching autophagic cell survival to apoptotic cell death.