Barley cultivation is adversely affected by high-temperature stress, which may modulate plant defense responses to pathogens such as barley powdery mildew (Blumeria graminis f. sp. hordei, Bgh). Earlier research focused mainly on the influence of short-term heat stress (heat shock) of barley on Bgh infection. In this study, our aim was to investigate the effects of both short- and long-term heat stress (35 °C from 30 s to 5 days) on Bgh infection in the barley cultivar Ingrid and its near-isogenic lines containing different powdery mildew resistance genes (Mla12, Mlg, and mlo5) by analyzing symptom severity and Bgh biomass with RT-qPCR. The expression of selected barley defense genes (BAX inhibitor-1, Pathogenesis- related protein-1b, Respiratory burst oxidase homologue F2, and Heat shock protein 90-1) was also monitored in plants previously exposed to heat stress followed by inoculation with Bgh. We demonstrated that pre-exposure to short- and long-term heat stress negatively affects the resistance of all resistant lines manifested by the appearance of powdery mildew symptoms and increased Bgh biomass. Furthermore, prolonged heat stress (48 and 120 h) enhanced both Bgh symptoms and biomass in susceptible wild-type Ingrid. Heat stress suppressed and delayed early defense gene activation in resistant lines, which is a possible reason why resistant barley became partially susceptible to Bgh.