The ubiquity of global change and its impacts on biodiversity poses a clear and urgent challenge for evolutionary biologists. In many cases, environmental change is so widespread and rapid that individuals can neither accommodate to them physiologically nor migrate to a more favourable site. Extinction will ensue unless the population adapts fast enough to counter the rate of decline. According to theory, whether populations can be rescued by evolution depends upon several crucial variables: population size, the supply of genetic variation, and the degree of maladaptation to the new environment. Using techniques in experimental evolution we tested the conditions for evolutionary rescue (ER). Hundreds of yeast populations were exposed to normally lethal concentrations of salt in conditions, where the frequency of rescue mutations was estimated and population size was manipulated. In a striking match with theory, we show that ER is possible, and that the recovery of the population may occur within 25 generations. We observed a clear threshold in population size for ER whereby the ancestral population size must be sufficiently large to counter stochastic extinction and contain resistant individuals. These results demonstrate that rapid evolution is an important component of the response of small populations to environmental change.