The licensed drug rapamycin has potential to be repurposed for geroprotection. A key challenge is to avoid the adverse side-effects of clinical dosing regimes. Here we show a profound memory effect of brief rapamycin treatment. Brief, early adult treatment extended lifespan in Drosophila to the same degree as lifelong dosing. Lasting memory of earlier rapamycin treatment was mediated by elevated autophagy in enterocytes of the gut, accompanied by increased intestinal spermidine levels and improved structure and function of the ageing intestine. Brief elevation of autophagy itself induced a long-term increase in autophagy. In mice, short-term, 3-month treatment also induced a full memory effect, with enhanced autophagy in Paneth cells, improved Paneth cell architecture and gut barrier function at levels induced by chronic treatment, even 6 months after rapamycin was withdrawn. Past rapamycin treatment also enhanced the regenerative potential of aged intestine in intestinal organoids. Full geroprotective effects of chronic rapamycin treatment can thus be obtained with a brief pulse of the drug.