We investigate the influence of a shifting environment on the spreading of an invasive species through amodel given by the diffusive logistic equation with a free boundary. When the environment is homogeneous and favourable, thismodelwas first studied in Du and Lin (SIAM J Math Anal 42: 377-405, 2010), where a spreading-vanishing dichotomy was established for the long-time dynamics of the species, and when spreading happens, it was shown that the species invades the new territory at some uniquely determined asymptotic speed c0 > 0. Here we consider the situation that part of such an environment becomes unfavourable, and the unfavourable range of the environment moves into the favourable part with speed c > 0. We prove that when c = c0, the species always dies out in the long-run, but when 0 < c < c0, the long-time behavior of the species is determined by a trichotomy described by (a) vanishing, (b) borderline spreading, or (c) spreading. If the initial population is written in the form u0(x) = sf(x) with f fixed ands > 0 a parameter, then there exists s0 > 0 such that vanishing happens when s. (0, s0), borderline spreading happens when s = s0, and spreading happens whens > sigma(0).