Metapopulation persistence in fragmented landscapes depends on habitat patches that can support resilient local populations and sufficient connectivity between patches. Yet epidemiological theory for metapopulations has largely overlooked the capacity of particular patches to act as refuges from disease, and has suggested that connectivity can undermine persistence. Here, we show that relatively warm and saline wetlands are environmental refuges from chytridiomycosis for an endangered Australian frog, and act jointly with connectivity to sustain frog metapopulations. We coupled models of microclimate and infection probability to map chytrid prevalence, and demonstrate a strong negative relationship between chytrid prevalence and the persistence of frog populations. Simulations confirm that frog metapopulations are likely to go extinct when they lack environmental refuges from disease and lose connectivity between patches. This study demonstrates that environmental heterogeneity can mediate host-pathogen interactions in fragmented landscapes, and provides evidence that connectivity principally supports host metapopulations afflicted by facultative pathogens.