In this paper, a phytoplankton–zooplankton model incorporating toxic substances and nonlinear phytoplankton harvesting is established. The existence and stability of the equilibrium of this model are first investigated. The occurrence of transcritical, saddle-node, Hopf and Bautin bifurcations at different equilibria is then verified. In addition, the properties of Hopf bifurcation and Bautin bifurcation are discussed by using normal form method. These results demonstrate that phytoplankton and zooplankton populations will oscillate periodically when the harvesting level is high. More interestingly, it is found that the oscillations are always unstable for small phytoplankton carrying capacity, while the dynamics have close relations with the initial population densities for a large environmental capacity. The existence of Bautin bifurcation theoretically indicates that toxic phytoplankton can cause extinction once there exist harmful algal blooms for some time. These results are numerically illustrated for the model with spatial diffusion, which shows that local phytoplankton blooms will lead to global populations extinction.