Previous studies reveal inconsistent associations between serum lipid traits and the risks of fractures and osteoporosis in the general population. This prospective cohort study analysed data from 414 302 UK Biobank participants (223 060 women and 191 242 men, aged 37-73 years) with serum lipid measurements: apolipoprotein A (Apo A), apolipoprotein B (Apo B), total cholesterol (TC), high-density lipoprotein cholesterol (HDL-C), low-density lipoprotein cholesterol (LDL-C), triglycerides (TG) and lipoprotein A (Lp(a)). Multivariable Cox proportional hazard models with penalized cubic splines were used to explore potential nonlinear associations of each lipid trait with the risks of fractures and osteoporosis. Subgroup analyses by age, sex, BMI categories and pre-existing cardiovascular disease were conducted. Mediation analyses using the g-formula were performed to quantify to which extent bone mineral density (BMD) may mediate the association between serum lipids and fracture risk. Over a median follow-up period of 13.8 years, 25 918 (6.8%) of the 383 530 participants without prior fracture had incident fracture cases, and 7591 (4.1%) of the 184 919 participants with primary care data and without baseline osteoporosis were diagnosed with osteoporosis. TG had nonlinear associations with fractures and osteoporosis, whereas Apo B, TC and LDL-C had linear associations. There were also nonlinear associations of Apo A and HDL-C with fractures. Individuals in the highest quintiles for Apo A (fracture: HR 1.15 [95% CI 1.10, 1.21]; osteoporosis: HR 1.13 [1.02, 1.25]) and HDL-C (fracture: HR 1.27 [1.20, 1.34]; osteoporosis: HR 1.31 [1.18, 1.46]) were associated with higher risks of fractures and osteoporosis. Conversely, those in the highest quintile for Apo B (fracture: HR 0.85 [0.81, 0.89]; osteoporosis: HR 0.86 [0.79, 0.94]), LDL-C (fracture: HR 0.89 [0.85, 0.93]; osteoporosis: HR 0.91 [0.83, 1.00]) and TG (fracture: HR 0.78 [0.74, 0.82]; osteoporosis: HR 0.75 [0.68, 0.82]) were associated with lower risks. The associations of Apo A (ratio of HR [RHR] 1.05 [1.02, 1.09]) and HDL-C (RHR 1.06 [1.03, 1.09]) with fracture risk were more pronounced in men compared to women. Except for TG and Lp(a), the associations between serum lipids and fractures appear to be partially mediated through BMD (mediation proportions: 5.30% to 40.30%), assuming causality. Our study reveals a complex interplay between different lipid markers and skeletal health, potentially partially mediated through BMD. Routine lipid profile assessments, including HDL-C and Apo A among other lipid traits, may be integrated into the strategies for fracture risk stratification.