Endothelial dysfunction (ED) precedes acute coronary syndrome. Oxidative stress results in ED but is reversible. Melatonin is aside from being a circadian hormone, also an antioxidant. The aim of this study was to investigate whether 25 mg melatonin administered for twelve weeks following acute coronary syndrome (ACS) could improve ED. In this placebo-controlled randomized trial, ED was measured as reactive hyperemia index (RHI) at baseline, day 14, and day 84. The effect was assessed using a generalized estimating equation adjusted for the baseline RHI. As secondary outcome, the concentrations of three biomarkers were measured: l-arginine, asymmetric dimethylarginine, and uric acid. Thirty-one patients were included in the study. The intention-to-treat analysis of the primary outcome had 26 patients due to missing data. The estimated marginal mean difference in RHI at day 14 and day 84 between the groups was 0.15 (95% CI: 0.29-0.01, P = .039) in favor of the placebo group. No significant differences in the biomarker concentrations were found. Melatonin treatment after ACS did not improve but may have aggravated ED. The significant difference between groups was in favor of placebo, but this might be due to the effect of missing data or uneven distribution of comorbidities.