Inbreeding is common in nature, and many laboratory studies have documented that inbreeding depression can reduce the fitness of individuals. Demonstrating the consequences of inbreeding depression on the growth and persistence of populations is more challenging because populations are often regulated by density- or frequency-dependent selection and influenced by demographic and environmental stochasticity. A few empirical studies have shown that inbreeding depression can increase extinction risk of local populations. The importance of inbreeding depression at the metapopulation level has been conjectured based on population-level studies but has not been evaluated. We quantified the impact of inbreeding depression affecting the fitness of individuals on metapopulation persistence in heterogeneous habitat networks of different sizes and habitat configuration in a context of natural butterfly metapopulations. We developed a spatial individual-based simulation model of metapopulations with explicit genetics. We used Approximate Bayesian Computation to fit the model to extensive demographic, genetic and life-history data available for the well-studied Glanville fritillary butterfly (Melitaea cinxia) metapopulations in the Åland islands in SW Finland. We compared 18 semi-independent habitat networks differing in size and fragmentation. The results show that inbreeding is more frequent in small habitat networks, and consequently, inbreeding depression elevates extinction risks in small metapopulations. Metapopulation persistence and neutral genetic diversity maintained in the metapopulations increase with the total habitat amount in and mean patch size of habitat networks. Dispersal and mating behaviour interact with landscape structure to determine how likely it is to encounter kin while looking for mates. Inbreeding depression can decrease the viability of small metapopulations even when they are strongly influenced by stochastic extinction-colonization dynamics and density-dependent selection. The findings from this study support that genetic factors, in addition to demographic factors, can contribute to extinctions of small local populations and also of metapopulations.