Coupling immunity and development is essential to ensure survival despite changing internal conditions in the organism. Drosophila metamorphosis represents a striking example of drastic and systemic physiological changes that need to be integrated with the innate immune system. However, nothing is known about the mechanisms that coordinate development and immune cell activity in the transition from larva to adult. Here, we reveal that regulation of macrophage-like cells (hemocytes) by the steroid hormone ecdysone is essential for an effective innate immune response over metamorphosis. Although it is generally accepted that steroid hormones impact immunity in mammals, their action on monocytes (e.g. macrophages and neutrophils) is still not well understood. Here in a simpler model system, we used an approach that allows in vivo, cell autonomous analysis of hormonal regulation of innate immune cells, by combining genetic manipulation with flow cytometry, high-resolution time-lapse imaging and tissue-specific transcriptomic analysis. We show that in response to ecdysone, hemocytes rapidly upregulate actin dynamics, motility and phagocytosis of apoptotic corpses, and acquire the ability to chemotax to damaged epithelia. Most importantly, individuals lacking ecdysone-activated hemocytes are defective in bacterial phagocytosis and are fatally susceptible to infection by bacteria ingested at larval stages, despite the normal systemic and local production of antimicrobial peptides. This decrease in survival is comparable to the one observed in pupae lacking immune cells altogether, indicating that ecdysone-regulation is essential for hemocyte immune functions and survival after infection. Microarray analysis of hemocytes revealed a large set of genes regulated at metamorphosis by EcR signaling, among which many are known to function in cell motility, cell shape or phagocytosis. This study demonstrates an important role for steroid hormone regulation of immunity in vivo in Drosophila, and paves the way for genetic dissection of the mechanisms at work behind steroid regulation of innate immune cells., Author Summary Hormones orchestrate physiological processes such as metabolism, immunity and development, and allow the body to respond systemically to external stresses and resources. Steroid hormones, such as sex hormones and corticosteroids, affect the function of the immune system, but how they do so is not well understood. The fruit fly Drosophila relies on the innate immune system to protect itself from infection by microbes. The high level of functional conservation of Drosophila immune cells, or hemocytes, with mammalian monocytes, and the powerful genetic tools makes the fly a useful model to uncover new aspects of innate immunity. Here, we have analyzed the regulation of hemocytes by the steroid hormone ecdysone at the moment when the juvenile larval form begins the process of metamorphosis, the drastic change of body plan that gives rise to an adult fly. We reveal that ecdysone rapidly activates hemocytes, increasing their ability to move, respond to wounds and engulf dead cells or invading bacteria. Hemocytes rendered insensitive to the hormone are not activated and as a result, the fly becomes susceptible to bacterial infections, compromising its survival. This study contributes to our understanding of steroid regulation of monocyte function, which has broad implications for human immunity.