The use of androgen biosynthesis and second-generation androgen receptor inhibitors for advanced prostate cancer is increasing. Because these therapies alter the androgen pathway, they have been associated with cardiometabolic and neurocognitive toxicities. Although their safety profiles have been assessed in clinical trials, real-world data are limited. A 20% sample of national Medicare claims was used to perform a retrospective cohort study of Medicare beneficiaries with advanced prostate cancer treated with androgen biosynthesis (ie, abiraterone) and second-generation androgen receptor inhibitors between 2012 and 2019. Outcomes were assessed after the first fill of either class of drug for the 12-month period after starting therapy. The primary outcome was a hospital admission or emergency department visit for a cardiometabolic event. Secondary outcomes included neurocognitive events and fractures. Multivariable regression was used to assess the association between the class of drug and occurrence of an adverse event. There were 3488 (60%) men started on an androgen biosynthesis inhibitor and 2361 (40%) started on an androgen receptor inhibitor for the first time. Cardiometabolic adverse events were more common in men managed with androgen biosynthesis inhibitor (9.2% vs 7.5%, P = .027). No difference between androgen biosynthesis and androgen receptor inhibitors was observed for neurocognitive events (3.3% vs 3.4%, respectively; P = .71) or fractures (4.2% vs 3.6%, respectively; P = .26). Men with advanced prostate cancer initiating an androgen biosynthesis inhibitor for the first time more commonly had cardiometabolic events than those started on androgen receptor inhibitors. Neurocognitive events and fractures did not differ by drug class.