BACKGROUND AND PURPOSE: Obesity is a risk factor for osteoarthritis in the lower limb, yet the cardiovascular risks associated with obesity in hip or knee replacement surgery are unknown. We examined associations between body mass index (BMI) and the risk of a major adverse cardiovascular event (MACE: ischemic stroke, acute myocardial infarction, or cardiovascular death) or the risk of all-cause mortality in a nationwide Danish cohort of patients who underwent primary hip or knee replacement surgery. METHODS: Using Danish nationwide registries, we identified 34,744 patients aged ≥ 20 years who underwent elective primary hip or knee replacement surgery between 2005 and 2011. We used multivariable Cox regression models to calculate the 30-day risks of MACE and mortality associated with 5 BMI groups (underweight (BMI < 18.5 kg/m(2)), normal weight (18.5-24 kg/m(2)), overweight (25-29 kg/m(2)), obese 1 (30-34 kg/m(2)), and obese 2 (≥ 35 kg/m(2))). RESULTS: In total, 232 patients (0.7%) had a MACE and 111 (0.3%) died. Compared with overweight, adjusted hazard ratios (HRs) were 1.2 (95% CI: 0.4-3.3), 1.3 (0.95-1.8), 1.6 (1.1-2.2), and 1.0 (0.6-1.9) for underweight, normal weight, obese 1, and obese 2 regarding MACE. Regarding mortality, the corresponding HRs were 7.0 (2.8-15), 2.0 (1.2-3.2), 1.5 (0.9-2.7), and 1.9 (0.9-4.2). Cubic splines suggested a significant U-shaped relationship between BMI and risks with nadir around 27-28. INTERPRETATION: In an unselected cohort of patients undergoing elective primary hip or knee replacement surgery, U-shaped risks of perioperative MACE and mortality were found in relation to BMI. Patients within the extreme ranges of BMI may warrant further attention.