An association between testosterone therapy (TT) and cardiovascular disease has been reported and TT use is increasing rapidly.We conducted a cohort study of the risk of acute non-fatal myocardial infarction (MI) following an initial TT prescription (N = 55,593) in a large health-care database. We compared the incidence rate of MI in the 90 days following the initial prescription (post-prescription interval) with the rate in the one year prior to the initial prescription (pre-prescription interval) (post/pre). We also compared post/pre rates in a cohort of men prescribed phosphodiesterase type 5 inhibitors (PDE5I; sildenafil or tadalafil, N = 167,279), and compared TT prescription post/pre rates with the PDE5I post/pre rates, adjusting for potential confounders using doubly robust estimation.In all subjects, the post/pre-prescription rate ratio (RR) for TT prescription was 1.36 (1.03, 1.81). In men aged 65 years and older, the RR was 2.19 (1.27, 3.77) for TT prescription and 1.15 (0.83, 1.59) for PDE5I, and the ratio of the rate ratios (RRR) for TT prescription relative to PDE5I was 1.90 (1.04, 3.49). The RR for TT prescription increased with age from 0.95 (0.54, 1.67) for men under age 55 years to 3.43 (1.54, 7.56) for those aged ≥ 75 years (p trend = 0.03), while no trend was seen for PDE5I (p trend = 0.18). In men under age 65 years, excess risk was confined to those with a prior history of heart disease, with RRs of 2.90 (1.49, 5.62) for TT prescription and 1.40 (0.91, 2.14) for PDE5I, and a RRR of 2.07 (1.05, 4.11).In older men, and in younger men with pre-existing diagnosed heart disease, the risk of MI following initiation of TT prescription is substantially increased.