OBJECTIVES: To compare the effect of hospitalization with medical illnesses on the suicide risk in the oldest old (> or = 80) with that in the old (65-79) and middle-aged (52-64) using nationwide data. DESIGN: Event-history analysis using time-varying covariates based on prospective individual-level register data. SETTING: Population-based record linkage. PARTICIPANTS: All persons aged 52 and older living in Denmark during 1996 to 1998 (N=1,684,205). MEASUREMENTS: The studied event is completed suicide. The following time-varying variables are included in the analysis: current age, hospitalization with medical illnesses within previous 2 years, and number of different medical diagnoses given at hospitalizations within previous 2 years. Relative suicide risks were calculated using event-history analysis. The proportional attributable risk was calculated to assess to which extent hospitalization can explain the increased suicide risk in the oldest old. RESULTS: During the 3-year study period, 1,184 persons committed suicide. Hospitalization with medical illnesses was associated with an increased suicide risk in the study population. The highest suicide rates were found in the oldest-old men who had been hospitalized during the previous 2 years: 113 per 100,000 versus 80 per 100,000 in the general population of men aged 80 and older. Also, the oldest-old women with a history of hospitalization had a higher suicide rate than their peer group. Nevertheless, the oldest old experienced a lower increase in risk after hospitalization than the middle-aged. Experiencing three or more different diagnoses increased the risk further. Almost two-thirds of the oldest old who committed suicide had experienced a medical hospitalization during a 2-year period preceding the suicide. A substantial part of the greater suicide rate in the oldest old than in the middle-aged can be attributed to the increased prevalence of medical hospitalization. CONCLUSION: The oldest old who have been hospitalized with medical illnesses have a significantly higher suicide risk than people in the same age range with no hospitalization, although they experience a lower increase in risk after hospitalization than the middle-aged. The increased prevalence of medical illnesses explains a part of the greater suicide risk with age, especially for the oldest old women. Considering that hospitalization with medical illness often precedes suicide in the oldest old, hospitalization may play an important role in identification of suicidal ideation in older people.