Most of the studies on epidemics so far have focused on the growing phase, such as how an epidemic spreads and what are the conditions for an epidemic to break out in a variety of cases. However, we discover from real data that on a large scale, the spread of an epidemic is in fact a recurrent event with distinctive growing and recovering phases, i.e., a hysteresis loop. We show here that the hysteresis loop can be reproduced in epidemic models provided that the infectious rate is adiabatically increased or decreased before the system reaches its stationary state. Two ways to the hysteresis loop are revealed, which is helpful in understanding the mechanics of infections in real evolution. Moreover, a theoretical analysis is presented to explain the mechanism of the hysteresis loop.