We propose and analyse an human immunodeficiency virus (HIV) infection model with spatial diffusion and delay in the immune response activation. In the proposed model, the immune response is presented by the cytotoxic T lymphocytes (CTL) cells. We first prove that the model is well-posed by showing the global existence, positivity, and boundedness of solutions. The model has three equilibria, namely, the free-infection equilibrium, the immune-free infection equilibrium, and the chronic infection equilibrium. The global stability of the first two equilibria is fully characterized by two threshold parameters that are the basic reproduction number R0 and the CTL immune response reproduction number R1. The stability of the last equilibrium depends on R0 and R1 as well as time delay τ in the CTL activation. We prove that the chronic infection equilibrium is locally asymptotically stable when the time delay is sufficiently small, while it loses its stability and a Hopf bifurcation occurs when τ passes through a certain critical value.