Understanding the consequences of inbreeding in combination with stress is important for the persistence of small endangered populations in a changing environment. Inbreeding and stress can influence the population at all stages of the life cycle, and in the last two decades a number of studies have demonstrated inbreeding depression for most life-cycle components, both in laboratory populations and in the wild. Although male fertility is known to be sensitive to temperature extremes, few studies have focused on this life-cycle component. We studied the effects of inbreeding on male sterility in benign and stressful environments using Drosophila melanogaster as a model organism. Male sterility was compared in 21 inbred lines and five non-inbred control lines at 25.0 and 29.0 °C. The effect of inbreeding on sterility was significant only at 29.0 °C. This stress-induced increase in sterility indicates an interaction between the effects of inbreeding and high-temperature stress on male sterility. In addition, the stress-induced temporary and permanent sterility showed significant positive correlation, as did stress-induced sterility and the decrease in egg-to-adult viability. This suggests that the observed stress-induced decline in fitness could result from conditionally expressed, recessive deleterious alleles affecting both sterility and viability simultaneously. © 2011 The Linnean Society of London, Biological Journal of the Linnean Society, 2011, 104, 432–442.