Osteoporosis is a chronic disease, carrying an elevated risk of fractures, morbidity, and death. Long-term treatment may be required, but the long-term risks with osteoporosis drugs remain incompletely understood. The competing risk of death may be a barrier to treating the oldest, yet this may not be rational if the risk of death is reduced by treatment. It is difficult to devise goal-directed long-term strategies for managing osteoporosis without firm information about residual life expectancy in treated patients. We conducted an observational study in Danish national registries tracking prescriptions for osteoporosis drugs, comorbid conditions, and deaths. We included 58,637 patients and 225,084 age- and sex-matched control subjects. Information on deaths until the end of 2013 was retrieved, providing a follow-up period of 10 to 17 years. In men younger than 80 years and women younger than 60 years, the relative risk of dying declined from being strongly increased in the first year to a stable but elevated level in subsequent years. In women older than 65 to 70 years, there was only a small elevation in risk in the first year of treatment followed by lower than background population mortality. The residual life expectancy of a 50-year-old man beginning osteoporosis treatment was estimated to be 18.2 years and that of a 75-year-old man was 7.5 years. Estimates in women were 26.4 years and 13.5 years, respectively. This study shows an excess mortality in men and in women younger than 70 years who are treated for osteoporosis compared with the background population. This excess risk is more pronounced in the first few years on treatment. The average life expectancy of osteoporosis patients is in excess of 15 years in women younger than 75 years and in men younger than 60 years, highlighting the importance of developing tools for long-term management.