Osteoporosis is common in the elderly, and it is associated with lifetime exposure to endogenous hormones and vitamin D intake, both of which are associated with cancer development. The association of osteoporosis with subsequent cancer has not been established, and hence we examined here the overall and site-specific cancer risks among Swedish individuals after hospitalization for osteoporosis. Patients with osteoporosis were identified from the Swedish Hospital Discharge Register and then linked to the Cancer Registry. Follow-up of patients was carried out from the date of first hospitalization, that is in or after 1969 to 2008. Standardized incidence ratios (SIRs) were calculated for cancers in these patients and these ratios were compared with those for individuals without osteoporosis. A total of 26 833 patients were hospitalized for osteoporosis during 1969–2008 and 3941 of them developed subsequent cancer, giving an overall SIR of 1.25; for cancer diagnosed after 1 year of follow-up the SIR was 1.06. A significant increase in risk was noted for cancers of the upper aerodigestive tract, skin (squamous cell carcinoma), and lung, and additionally for myeloma. The risk was decreased for breast, endometrial, and ovarian cancers among female patients. Patients with multiple hospitalizations showed higher risks for myeloma and skin cancer and lower risk for breast and endometrial cancers. In total, a 25% increase in cancer risk was noted among osteoporosis patients, but the increase was confined mainly to the first year after hospitalization. However, the increased risk of certain types of cancers calls for clinical attention.