Immunity of parasites has been studied amazingly little, in spite of the fact that parasitic organisms, especially the arthropod parasites, need immunity to survive their own infections to successfully complete life cycles. Long-term effects of challenging environmental temperatures on immunity have remained unstudied in insects and parasites. Our study species, the deer ked (Lipoptena cervi; Linnaeus 1758), is an invasive, blood-feeding parasitic fly of cervids. Here, it was studied whether thermal stress during the pupal diapause stage could modify adult immunity (encapsulation capacity) in L. cervi. The effect of either a low temperature or high temperature peak, experienced during winter dormancy, on encapsulation response of active adult was tested. It was found that low temperature exposure during diapause, as long as the temperature is not too harsh, had a favourable effect on adult immunity. An abnormal, high temperature peak during pupal winter diapause significantly deteriorated the encapsulation capacity of emerged adults. The frequency and intensity of extreme weather events such as high temperature fluctuations are likely to increase with climate change. Thus, the climate change might have previously unknown influence on host-ectoparasite interactions, by affecting ectoparasite's immune defence and survival.