The percolation paradigm is widely used in spatially explicit epidemic models where disease spreads between neighbouring hosts. It has been successful in identifying epidemic thresholds for invasion, separating non-invasive regimes, where the disease never invades the system, from invasive regimes where the probability of invasion is positive. However, its power is mainly limited to homogeneous systems. When heterogeneity (environmental stochasticity) is introduced, the value of the epidemic threshold is, in general, not predictable without numerical simulations. Here, we analyse the role of heterogeneity in a stochastic susceptible–infected–removed epidemic model on a two-dimensional lattice. In the homogeneous case, equivalent to bond percolation, the probability of invasion is controlled by a single parameter, the transmissibility of the pathogen between neighbouring hosts. In the heterogeneous model, the transmissibility becomes a random variable drawn from a probability distribution. We investigate how heterogeneity in transmissibility influences the value of the invasion threshold, and find that the resilience of the system to invasion can be suitably described by two control parameters, the mean and variance of the transmissibility. We analyse a two-dimensional phase diagram, where the threshold is represented by a phase boundary separating an invasive regime in the high-mean, low-variance region from a non-invasive regime in the low-mean, high-variance region of the parameter space. We thus show that the percolation paradigm can be extended to the heterogeneous case. Our results have practical implications for the analysis of disease control strategies in realistic heterogeneous epidemic systems.