The long-term relationship between hypothyroidism and fracture risk is challenging to dissect because of the modifying influence of subsequent thyroxine replacement with the potential for excessive replacement doses. We studied changes in serum thyrotropin concentration (TSH) over time and association with fracture risk in real-world patients presenting with elevated TSH. All TSH determinations were done in the same laboratory, which served all hospitals and general practices. The study population consisted of all adults with a first measurement of TSH >4.0 mIU/L (n = 8414) or normal TSH (n = 222,138; comparator). We used a Cox proportional hazards analysis incorporating additional time-dependent covariates to represent initiation of thyroxine replacement and cumulative number of periods with high versus low TSH after index date with a mean follow-up of 7.2 years. Elevated baseline TSH was not associated with an increased risk of hip fracture (HR 0.90; 95% CI, 0.80 to 1.02) or major osteoporotic fractures (HR 0.97; 95% CI, 0.90 to 1.05), nor was subsequent thyroxine prescription predictive of increased risk of fractures. The number of subsequent 6-month periods with low TSH - suggesting excessive thyroxine dosing - was significantly associated with increased risk of both hip fracture (HR 1.09; 95% CI, 1.04 to 1.15) and major osteoporotic fracture (HR 1.10; 95% CI, 1.06 to 1.14). When gender- and age-stratified analyses for major osteoporotic fractures were undertaken, hyperthyroid time was identified as a predictor of fracture risk in postmenopausal women whereas hypothyroid time predicted increased fracture risk in men below age 75 years. In conclusion, among patients who present with an elevated TSH, the long-term risk of hip and other osteoporotic fractures is strongly related to the cumulative duration of periods with low TSH - likely from excessive replacement. An independent effect of elevated TSH could only be observed in young and middle-aged men, suggesting gender-discrepant consequences on risk.