BACKGROUND: Fever of unknown origin is associated with cancer, but the tumour types most commonly involved and the prognostic implications of this relation have not been studied. We aimed to assess the risk of cancer and survival after hospital admission for fever of unknown origin in a nationwide Danish follow-up study. METHODS: We linked the Danish national registry of patients and the nationwide cancer registry, and assessed cancer risk for 43,205 patients discharged for the first time from Danish hospitals after admission for fever of unknown origin during 1977-97. We compared cancer frequency with that expected on the basis of cancer incidence in the general population, and survival of patients with cancer who had had fever of unknown origin with that of controls (ie, patients with cancer matched for cancer site, age at time of cancer diagnosis, and year of cancer diagnosis). FINDINGS: Median follow-up was 6.3 years (IQR 2.7-12.3). During the first year of follow-up, 399 cancers were diagnosed in those who had had fever of unknown origin (standardised incidence ratio 2.3 [95% CI 2.1-2.5]). These individuals had an increased risk of developing cancer--in particular haematological malignant disease; sarcoma; and cancers of the liver, brain, kidney, colon, and pancreas. After 1 year of follow-up, individuals had an increased risk of developing haematological malignant disease and cancers of the liver, brain, and kidney. A slightly higher proportion of people diagnosed with cancer within 1 year of hospital discharge after fever of unknown origin had distant metastases compared with controls (101 [34%] of 294 vs 819 [28%] of 2907; prevalence ratio 1.2 [95% CI 1.0-1.4], and had worse survival than did controls (mortality rate ratio 1.4 [95% CI 1.2-1.6]). INTERPRETATION: Hospital admission for fever of unknown origin is a marker of occult cancer and is associated with a poor outlook.