To investigate the role of immunity-related medical conditions in the aetiology of oesophageal cancer, data were analysed from a population-based case-control study, conducted in Shanghai during 1992-93. Information on histories of selected autoimmune diseases and allergic conditions was obtained from 163 incident cases of oesophageal cancer and 275 age- and sex-matched controls through personal interviews using a structured questionnaire. A significant 2.4-fold excess risk (95% CI, 1.3-4.4) of oesophageal cancer was associated with a history of autoimmune diseases after adjustment for age and sex. In contrast, a history of allergy was associated with a reduced risk (adjusted OR = 0.6, 95% CI = 0.4-0.9). The risk was also reduced 30-40% among individuals who reported having a moderate or strong skin reaction to mosquito bites. This study suggests that host immune function may be involved in the aetiology of oesophageal cancer. Further investigations into the mechanism of these observed associations are warranted.