Background: Symptoms of depression and anxiety are common after a myocardial infarction (MI). Internet-based cognitive behavioral therapy (iCBT) has shown good results in other patient groups. Objective: The aim was to evaluate the effectiveness of an iCBT treatment to reduce selfreported symptoms of depression and anxiety among patients with a recent MI. Methods: In total, 3928 patients were screened for eligibility in 25 Swedish hospitals. Of these, 239 patients (33% women, mean age 60 years) with a recent MI and symptoms of depression or anxiety were randomly allocated to a therapist-guided, 14 week iCBT treatment (n=117), or treatment as usual (n=122). The iCBT treatment was designed for post MI patients. The primary outcome was the total score of the Hospital Anxiety and Depression Scale (HADS) 14 weeks post baseline, assessed online. Treatment effect was evaluated according to the intention-to-treat principle, with multiple imputations. For the main analysis, a pooled treatment effect was estimated, controlling for age, sex, and baseline HADS. Results: There was a reduction in HADS scores over time in the total study sample (mean = -5.1, Δ P < .001) but no difference between the study groups at follow-up ( β = -0.47 [95% confidence interval, -1.95 to 1.00], P = .53). Treatment adherence was low. 46% of the iCBT group did not complete the introductory module. Conclusions: iCBT treatment for an MI population did not result in lower levels of symptoms of depression or anxiety compared to treatment as usual. Low treatment adherence might have influenced the result.