During morphogenesis, remodelling of cell shape requires the expansion or contraction of plasma membrane domains. Here we identify a mechanism underlying the restructuring of the apical surface during epithelial morphogenesis in Drosophila. We show that the retraction of villous protrusions and subsequent apical plasma membrane flattening is an endocytosis-driven morphogenetic process. Quantitation of endogenously tagged GFP::Rab5 dynamics reveals a massive increase in apical endocytosis that correlates with changes in apical morphology. This increase is accompanied by the formation of tubular plasma membrane invaginations that serve as platforms for the de novo generation of Rab5-positive endosomes. We identify the Rab5-effector Rabankyrin-5 as a regulator of this pathway and demonstrate that blocking dynamin activity results in the complete inhibition of tubular endocytosis, in the disappearance of Rab5 endosomes, and in the inhibition of surface flattening. These data collectively demonstrate a requirement for endocytosis in morphogenetic remodelling during epithelial development.