Somatic stem cells constantly adjust their self-renewal and lineage commitment by integrating various environmental cues to maintain tissue homeostasis. Although numerous chemical and biological signals have been identified that regulate stem-cell behaviour, whether stem cells can directly sense mechanical signals in vivo remains unclear1. Here we show that mechanical stress regulates stem-cell differentiation in the adult Drosophila midgut through the stretch-activated ion channel Piezo. We find that Piezo is specifically expressed in previously unidentified enteroendocrine precursor cells, which have reduced proliferation ability and are destined to become enteroendocrine cells. Loss of Piezo activity reduces the generation of enteroendocrine cells in the adult midgut. In addition, ectopic expression of Piezo in all stem cells triggers both cell proliferation and enteroendocrine cell differentiation. Both the Piezo mutant and overexpression phenotypes can be rescued by manipulation of cytosolic Ca2+ levels, and increases in cytosolic Ca2+ resemble the Piezo overexpression phenotype, suggesting that Piezo functions through Ca2+ signalling. Further studies suggest that Ca2+ signalling promotes stem-cell proliferation and differentiation through separate pathways. Finally, Piezo is required for both mechanical activation of stem cells in a gut expansion assay and the increase of cytosolic Ca2+ in response to direct mechanical stimulus in a gut compression assay. Thus, our study demonstrates the existence of a specific group of stem cells in the fly midgut that can directly sense mechanical signals through Piezo.